Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strtofile returns 135 but nothing gets written
Message
From
09/02/2016 18:34:13
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01631161
Message ID:
01631163
Views:
69
Hi Naomi
i tried this similar test code and it works as well for me.try to verify the strtofile params.
*create a  folder in c:\ProgramData as myDir and export the filetostr content to file log.txt (appending)
* i dont run vfp9 as administrator.I dont change any attribute of myDir folder.

declare integer Sleep in kernel32 integer
#define cr chr(13)+chr(10)
if ! directory("C:\ProgramData\myDir")
md  "C:\ProgramData\myDir"  &&create folder myDir if dont exist
endi

for i=1 to 4  &&test 4 sends
local m.myvar
text to m.myvar textmerge  noshow
<<ttoc(dateTime())>>
**********
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vel risus eget lorem feugiat
fermentum nec a turpis. Phasellus purus sem, mollis ac posuere eget, ornare vel orci. Sed ac rutrum
nulla. Aenean ultrices eget lectus eu efficitur. In hac habitasse platea dictumst. 
***********
endtext
=strtofile(cr+m.myvar+cr,"c:\ProgramData\myDir\log.txt",.t.)  &&sent to log all 2 seconds
sleep(2000)  
endfor
run/n notepad c:\ProgramData\myDir\log.txt
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform