Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Storing program statements in a memo field
Message
From
19/06/1999 16:36:22
 
 
To
19/06/1999 13:47:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00231760
Message ID:
00231811
Views:
24
>Currently, I am using this command cMessage = "Job Number: ' + customer.jobnumber + ' has been cancelled' in the program. I want to change that so I am storing "Job Number: " + customer.jobnumber + ' has been cancelled' to a memo field in a table. In the program, I want to set cMessage = table.memo and have it evaluate the contents of memo field and return the current value of customer.jobnumber instead of the literal customer.jobnumber. By putting that command into a memo field rather than coding it in a program, I would be able to change the message without having to go into the code. It would also make it generic enough so other programs could call it. Is this possible or is there a better way to accomplish this?
>

Oh, OK, I misunderstood what you were trying to do. Yeah, you can do that, but you have to do it like this:

cMessage = "'Job Number: ' + customer.jobnumber + ' has been cancelled'"
REPLACE MyTable.Memo WITH cMessage

pay special attention to the placement of the single and double quotes. Then when you want to evaluate customer.jobnumber later, you have to use:

MESSAGEBOX(EVAL(MyTable.Memo))

since you actually stored quotes inside the memo, you can have the EVAL function actually "evaluate" the contents of the memo, insteadof just displaying them.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform