Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Possible Win 2000 issue
Message
 
 
To
04/02/2002 15:05:47
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00614593
Message ID:
00615013
Views:
21
Did you try to delete file "items.txt" before Strtofile() from within VFP or outside?

>I tried assigning the value to a variable per Jerry's suggestion. I also hard-coded the directory for testing this although I was certain where it was being written.
>
>It is very interesting to me because I can watch the behavior and see the time stamp on the file which tell me that the file is created the first time only. The code is very minimal and straightforward. It works perfectly under Win98 but not Win2000 or WinME. (I just tried ME last night.)
>
>Honestly, I had never before used STRTOFILE() but am trying to exploit functions that I have neglected. It is just the right function for this situation. Not sure how else I would write the edit box to a text file.
>
>By the way, I am absolutely sure that nothing else is accessing the text file.
>
>>The zero return value means that either empty string was written to file or STRTOFILE() failed for some reason. The first one isn't the case because there wasn't empty file created. The second is hard do diagnose because STRTOFILE() doesn't provide any feedback of why it failed.
>>What is pazzling that file is created for a first time. To isolate the problem try following:
>>- Exclude posibility that long property reference somehow affects STRTOFILE().
lcItems = THISFORM.OrderPageFrame.Page2.ItemNumbers.Value
>>STRTOFILE(lcItems, 'items.txt')
>>- Check in what directory your program actualy tries to write this file or specify full path for the second parameter.
>>
>>>Good questions. I checked the return value. Zero. The return value on the Win98 PC was greater than zero and, per my calculation, was correct. Before that I searched the entire PC for the file. None found. I checked the value of the edit box by popping in a button that popped up the value. The value was just as seen on screen.
>>>
>>>>Hi Greg,
>>>>
>>>>What is return value from STRTOFILE() when file isn't created?
>>>>Maybe current directory somehow changed and file was created but not in the directory you expected?
>>>>
>>>>>I use the following statement in a form. ItemNumbers is an edit box. It has been serving its purpose quite neatly until now.
>>>>>
>>>>>=STRTOFILE(THISFORM.OrderPageFrame.Page2.ItemNumbers.Value,'items.txt')
>>>>>
>>>>>I spent the last hour observing it fail. I have isolated the issue to this specific statement as I can view from Windows Explorer the items.txt file. Interestingly, this statement only works once for this form. When it is executed again, the items.txt file is not created.
>>>>>
>>>>>I have been banging my head trying to figure this out. Finally, I ran the exact same app on a different machine. It worked!
>>>>>
>>>>>The app that choked on this was running on a Win2000 machine. The app that ran this fine is on a Win98 machine.
>>>>>
>>>>>Any suggestions?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform