Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
STRTRAN not working
Message
 
 
To
12/06/2003 13:43:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00799472
Message ID:
00799479
Views:
35
>Any idea why the substitute is not working?
>
>
>
>lcline=""
>lccode="COPY %1 <<IMPORTPATH>> <<IMPORTFILE>>"
>BG_ACCUWIN="C:\FOXPRO\TMP\"
>FOR i = 1 TO LEN(lccode)
>    IF ASC(SUBSTR(lccode,i,1))=13 .or. ASC(SUBSTR(lccode,i,1))=13
Both sides of the .OR. are the same expression. So the IF code never gets fired. Only the code in the ELSE fires.
>        lcline=lcline+CHR(13)+CHR(10)
>        ? lcline
>        IF "<<IMPORTPATH>>" $ lcline
>		STRTRAN(lcline,"<<IMPORTPATH>>",BG_ACCUWIN)
>        ENDIF
>        IF "<<IMPORTFILE>>" $ lcline
>		STRTRAN(lcline,"<<IMPORTFILE>>","ACCUWIN.TXT")
>        ENDIF
>	    i = i+1
>    ELSE
>        lcline=lcline+SUBSTR(lccode,i,1)
>    ENDIF
>	=FPUTS(m.handle,lcline)
>ENDFOR
>=FCLOSE(m.handle)
>MODIFY COMMAND test.txt
>
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform