Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use 'DO command IN exe' WITH ?
Message
From
18/08/2010 16:45:30
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
18/08/2010 13:28:24
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01476909
Message ID:
01477155
Views:
78
Mike, this easily misinterpreted snippet is in the VFP9 Help:

>>When you use the DO command to start a procedure in an executable version or in an application, Visual FoxPro searches only the main program of the executable version or application for the specified procedure.

If you have multiple possible procs you need to run in a separate exe, either you can load them all into the main program (since the upper .prg size limit is gone) or you can create a loader proc in the main.prg that calls the proper proc. I've seen this done by passing the procedure name as a parameter to be executed by ¯o substitution or EVAL() but IMHO that creates a security risk since theoretically a hacker could run unexpected procs via that means... but it should be OK if the loader checks an environment variable or expects a parameter so you can ensure that calls are from your own work. An extra encrypted string parameter including datetime() isn't a bad option.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform