Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running object code
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00901152
Message ID:
00901485
Views:
14
Hi Nick,

I've read through some of the other responses and have another (possibly long winded) possibility.

I have a pseudo-command line utility that I use for maintenance in my apps. You enter a line of code and it runs it.

The way I do it is to build each line as a string and then use macro sub. to run it.

Lets say you have a memo field (MyCode, in a table called MyProcs) that reads:

LOCAL lcMessage
lcMessage = "Test"
=MESSAGEBOX(lcMessage)

You then use a bit of code like this to read each line and fire it.

*-- Code Fragment Begins
LOCAL lnLines, lnThisLine, lcCmd

*-- Determine Lines of Code
lnLines = MEMLINES(MyProcs.MyCode)

IF lnLines <= 0
RETURN
ENDIF

*-- Loop through and fire commands
FOR lnThisLine = 1 TO lnLines
lcCmd = ALLTRIM(MLINE(MyProcs.MyCode, lnThisLine))

&lcCmd.
ENDFOR
*-- Code Fragment Ends

There are limitations to what you could run in this way and it's not something I have tried. Although I have used similar methods to read code entered into an edit box or from a text file.

Regards,

Ben
Ben Sugden

"Remember to enjoy hunting - and that means relishing the search for the product that has never been advertised or placed handily at the front of the shop; Life begins on the uppermost shelf, avoid guide books and top 10's like the plague." - Ramsey Dukes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform