I want to subclass FolderItem (or maybe TextInputStream, I'm not sure) and add a LineCount method to it. There are a number of places where I need to know how many lines a text file has. However, the way I'm doing this doesn't seem to work. For instance, if I subclass FolderItem as MyFolderItem and add a LineCount method to it, how do I use it when the built-in classes return FolderItems? First I tried casting:

dim newFile as new FolderItem = App.AppSupportFolder.Child(fileName)
dim lines as Integer = MyFolderItem(newFile).LineCount

But I got an illegal cast error at compile. Then I tried to dim newFile as a MyFolderItem, but RB won't let me assign the results of the Child method to anything but a FolderItem.

Is there a better way to do this?

Thanks,
Chuck Ross
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to