Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strtofile does't works at run time!
Message
From
30/09/2002 12:42:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00705868
Message ID:
00705971
Views:
8
Looks like a buffering problem perhaps?

We discovered that writing with STRTOFILE() from multiple computers caused a loss of text when the file did not exist. With 3 computers using STRTOFILE() in a loop, if the file didn't exist the first line of text was always missing. There was definitely buffering going on because we didn't get one line from computer 1, then one from computer2, then one from computer 3. Instead we got blocks of around a hundred from each.

We couldn't find any problems with STRTOFILE() when the file existed before the first write, even with multiple computers writing to it at the same time.
We couldn't see any problems with only one user. Whether or not the file existed, it always worked.


Mark's suggested AQUI = JUSTSTEM(ARQUIVOSTXT[QWER,1]) instead of the LEFT() function. You might find ARQUIVO = FORCEEXT("VELHO_"+ARQUIVOSTXT[QWER,1],".txt") a better way of making sure that if the extension isn't ".txt" it is set to the right extension.

Instead of =STRTOFILE() you can check the value returned, it tells you how many bytes were written to the file. Do you find any difference between the number it gives you and the length of the AQUI string?
Previous
Reply
Map
View

Click here to load this message in the networking platform