Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing Code From A Memo Field?
Message
From
19/03/1998 17:04:03
 
 
To
19/03/1998 16:43:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00085742
Message ID:
00085820
Views:
35
Edward,

>>Ed,
>>
>>So you're saying that if I had a memo field with the following in it:
>>SELECT foobar
>>ln_count = 0
>>SCAN WHILE foobar.item = "TEST"
>> ? foobar.description
>> ln_count = ln_count + 1
>>ENDSCAN
>>? ln_count
>>
>>That the following code would run it correctly through macro expansion?
>>
>>for n=1 to memlines(memofield)
>> cCommand=mline(memofield,n)
>> &cCommand.
>>endfor
>>
>>I tried something similar, but it didn't work. It generates an error when you try to macro expand the initial loop line. Any way around that?
>
>This code was tested before posted. You probably have syntax error inside memo field code.

This can't work. You would get a nesting error when &cCommand came out as the SCAN line - a SCAN without an ENDSCAN. The same would be true of any kind of looping construct.

I keep meaning to find time to look at CodeBlock to see how it handles this.

Matt.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform