Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing Code From A Memo Field?
Message
De
19/03/1998 17:04:03
 
 
À
19/03/1998 16:43:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00085742
Message ID:
00085820
Vues:
31
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform