Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing Code From A Memo Field?
Message
De
20/03/1998 09:18:49
 
 
À
20/03/1998 09:08:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00085742
Message ID:
00085958
Vues:
35
>Edward,
>
>>
>>Sorry, Matt, but I don't understand what you mean here. Firstly, my example was about FOR..ENDFOR. Secondly, why just not try this simple code and then make a conclusion?
>
>I have tried it - it doesn't work.
>
>
>OK, if I understand you correctly, you are saying that I can create a memo field with (as a simple example) the following contents:
>
>FOR x = 1 to 10
> WAIT WINDOW STR(x)
>ENDFOR
>
>Then, I can execute the following:
>
>FOR n=1 TO memlines(mymemofield)
> cCommand=mline(mymemofield,n)
> &cCommand.
>ENDFOR
>
>However, for n = 1, cCommand will equate to:
>
>FOR x = 1 to 10
>
>Executing this line on its own (as above) will generate an error (as I have demonstrated to myself).
>
>If _you_ have an example of this working, I'd love to see it. Loops of any kind cannot be executed with macro expansion - although CodeBlock has a workaround for this by simulating the loop.
>
>Matt.

It's probably mysterious morning (or bad day:). Why "cCommand will equate to FOR x = 1 to 10"? I also built simple memo with 3 lines wtih different WAIT WINDOW commands and it works! If, for example, first line of meo contains WAIT WINDOW "Line1" timeout 2, then cCommand='WAIT WINDOW "Line1" timeout 2' and &cCommand. works Ok. I really lost in your reply.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform