Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem when using EXECSCRIPT()
Message
From
17/10/2005 06:43:58
 
 
To
17/10/2005 06:12:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01059568
Message ID:
01059573
Views:
9
This message has been marked as the solution to the initial question of the thread.
Agnes,

The code in EXECSCRIPT() runs in a different context to the form. When you use macro substitution, it runs in the context of the form. What you could do to reference THISFORM in EXECSCRIPT() is as follows :-
*-- In the form before calling EXECSCRIPT()
PRIVATE oTHISFORM
m.oTHISFORM = THISFORM
In the EXECSCRIPT code, change the reference(s) from THISFORM to m.oTHISFORM - because you have defined m.oTHISFORM as a PRIVATE variable, it will still be in scope and therefore can be seen by the code in the EXECSCRIPT call.

HTH.



>HI ,
>
>Help me Please .
>
>I use 'Execscript' to run a code which is stored in a table . But an error appeared :'THISFORM can only be used within a method'
>
>with a macro substitution there's no problem . But I want to use 'Execscript'
>
>Regards
-=Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform