Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strtofile in compiler give other results than foxpro
Message
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01308506
Message ID:
01308972
Views:
11
Hello

look at the comments on your code


SET DEFAULT TO c:
CREATE TABLE "KLM" (VELD1 n(10,2))
CREATE TABLE klm1 (veld2 N(10,2))

SELECT klm
*!*
APPEND FROM klm1
*!* HERE you add an empty record to klm



FOR i=1 TO 1000
INSERT INTO klm VALUES (i)

*!* here you add records 2 to 1001 to klm
*!* so in efect you have record 1 empty
*!* and recrods 2 to 1001 the numbers 1 to 1000

INSERT INTO klm1 values(i)
endfor



SELECT klm

cString = ""
FOR i =1 TO 1000
GOTO i
cString = cString + ALLTRIM(STR(veld1)) + CHR(13) + CHR(10)

*!* here you add to your string recrds 1 to 1000
*!* thats an empty one and the numbers 1 to 999

ENDOR

STRTOFILE(cString,"myfile.txt")


hope this helps



>Hi Samuel,
>
>Using the last(temporary) version of the compiler you have sent me. I get some unexpected results when using strtofile (also in comparison with foxpro). I have the following code:
>
>SET DEFAULT TO d:\weggooi
>CREATE TABLE "KLM" (VELD1 n(10,2))
>CREATE TABLE klm1 (veld2 N(10,2))
>
>SELECT klm
>APPEND FROM klm1
>
>FOR i=1 TO 1000
>	INSERT INTO klm VALUES (i)
>	INSERT INTO klm1 values(i)
>endfor	
>
>SELECT klm
>
>cString = ""
>FOR i =1 TO 1000
>	GOTO i
>	cString = cString  + ALLTRIM(STR(veld1)) + CHR(13) + CHR(10)
>ENDFOR
>
>STRTOFILE(cString,"d:\weggooi\myfile.txt")
>
>
>Myfile.txt begins with an empty line ("") while you would expect 1, and it ends with 999, while you would expect 1000. Maybe you can have a look at this.
>
>BTW, a real improvement in comparison with the previous version. I really like the new run command in the toolbar.It looks very promising,thanks.
B.D.H.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform