Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rusty on the syntax - how to fix this?
Message
From
16/07/2017 15:51:41
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01652659
Message ID:
01652674
Views:
82
This message has been marked as a message which has helped to the initial question of the thread.
>>The above code doesn't work anymore :(

Assign the image source to a lcImageSource variable and wrap it in () in the copy memo. If it might be an expression, check for a bracket and eval() it first. This lets you do away with the macro substitution as well...
CREATE CURSOR test (myval m)
APPEND BLANK

Savefile("myval",ADDBS(SYS(2023))+"t1.txt")
Savefile("GetMyval()",ADDBS(SYS(2023))+"t2.txt")

FUNCTION SaveFile(lcimagesource,lcFilename)
REPLACE myval WITH m.lcImagesource
IF "(" $ m.lcimagesource
	lcimagesource=EVALUATE(m.lcimagesource)
ENDIF
COPY MEMO (m.lcImageSource) to (m.lcFilename)
MODI FILE (m.lcFilename)
ERASE (m.lcfilename)
RETURN

FUNCTION GetMyval()
RETURN "myval"
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Reply
Map
View

Click here to load this message in the networking platform