Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 Tip-o-the-day STRTOFILE() FILETOSTR()
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00122710
Message ID:
00122715
Views:
33
Gary,

Well, string variables aren't really limited to 255 characters in VFP5. For instance, cTest=REPLICATE('X',500) will work fine. The problem is that if you say cTest='xxx...' with more than 255 characters in the string you get an error. I tried this in VFP 6 and got a different error ("Command contains unrecognized phrase/keyword" instead of "Syntax error"). Not much progress there.

You can certainly use FILETOSTR() and STRTOFILE() with larger strings. I just succsessfully used FILETOSTR() with a 20K text file.

>Cool! Are string variables limited to 255 characters in VFP6 as they have been in previous versions?
>
>>Folks,
>>
>>Have you ever needed to write a character string to a file, or read a file into a character string. Perhaps you used a memo field to hanlde the requirement. In VFP6 you can use the STRTOFILE() function to write a character string to a file, or append it to one. The FILETOSTR() function reads a file and stores the contents into a string variable.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform