Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Emulating Visual Foxpro Command Window
Message
From
02/08/2000 23:52:46
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00399066
Message ID:
00400222
Views:
17
>>>Hi there
>>> I created a form with a Edit Box in it to Emulate Foxpro Command window in my Application. The form is called from
>>>"Development" menu with "Do form" method.
>>> The problem is it can't see any varibles I created in the Edit BOx. For example, If I type in the following two commands:
>>>
>>>a=5 (press enter)
>>>?a (press enter)
>>>
>>> Then I got error message saying "Variable not found".
>>> In the form Keypress (Case Keycode=13), I validate the expression then use &lcommand to execute it.
>>> It works fine on my table sql statements.
>>>
>>> I am new to Visual Foxpro. Much appreciated if can help
>>>
>>> My Email is wtian@csc.com.au
>>
>>Daniel,
>>
>>To my knowledge, what you are trying to do is possible, but I can't for the life of me figure out why you would want to go to the trouble. What you would have to do would be to parse the contents of the edit box on a line by line basis, and feed the values to the VFP engine.
>>
>>Something along the lines of ;
>>
>>
>>Determine what text constitutes the last line.
>>Fetch it into a memory variable or other holding place.
>>[simple] Macro substitute to execute the command.
>>[complex] Parse the line looking for keywords, procedure names, function calls etc... and construct a valid command line then macro substitute to make it run.
>>
>>In a nutshell, this would really be a great deal of work.
>>
>>Regards,
>>
>>Jason Tryon
>
>Another simple idea (VFP6.0 required):
>
>local lcString, lcFile, lcDelFile
>lcFile=addbs(gcTempPath)+'pr'+sys(2015)+'.prg' && temprorary procedure filename
>lcString=rtrim(thisform.myCmdEdit.value) && Value in your EditBox
>strtofile(lcString,lcFile)
>if file (lcFile)
>   compile (lcFile)
>   do lcFile && Execute all lines in EditBox
>   lcDelFile=forceext(lcFile,"*")
>   erase lcDelFile

This won't work, it'll try to delete a file "lcDelFile";  you need to use name
resolution, like:

   erase (lcDelFile)

>else
>   ** something's wrong
>endif
>
>
>This is from the top of my head and untested, but should give you idea...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform