General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only