Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing Code From A Memo Field?
Message
From
20/03/1998 09:18:49
 
 
To
20/03/1998 09:08:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00085742
Message ID:
00085958
Views:
37
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform