|
-
May 14th, 2000, 07:58 AM
#1
Access to class properties
Hello world,
i wrote a wrapper class for Strings (like CString in Visual C++). There is only one private property (the string of course), some methodes and of course property methods to get/let the string.
The property methods are the default property for the class.
Now the problem:
When i try to read a string from a file directly into my object, it doesn't work:
Dim s as new clsString
Dim f as Integer
f = FreeFile()
Open "C:\autoexec.bat" for input Access Read as #f
Line input #f, s
Close #f
What can i do?
help appreciated
Peter
-
May 14th, 2000, 11:48 AM
#2
Re: Access to class properties
Try:
Line input #f, s.PropertyName
Where PropertyName is the name of your string property. I know that if you have it set as the default property it should work your way, but I have found that sometimes you have to call the property name explicitly.
You also might try putting the read from the file into a VB String first, then passing that to the let property of your class.
Hope this helps.
Spectre
-
May 15th, 2000, 08:39 AM
#3
Re: Access to class properties
Thank you for you answer.
Using the property-name explictily doesn't work. VB seems to expect a VB-string as parameter.
Putting the read string in a VB-string first will work but this are 2 additional lines of code.
Isn't there a possibility to do it directly?
Bye
Peter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|