Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem when using EXECSCRIPT()
Message
From
17/10/2005 06:18:02
 
 
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:
01059571
Views:
12
>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'


Agnes,

The error correctly indicates that you cannot apply THISFORM unless you are running inside the form (as a container).
You can always use with _SCREEN.ActiveForm to get a reference to whichever form is active from the Forms collection.

A better way if you want to run that program from anywhere outside a form would be to take a reference to the ActiveForm and then use that to refer to the form's PEMs.

ExecSript() is very powerful but very dangerous as anybody could change the program inside your Memo field and make a malicious entry. Be sure to either have the code encrypted or somehow validate that it has not been changed by unauthorised hands.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform