Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Logging to Command Window
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01141328
Message ID:
01141357
Views:
22
This message has been marked as the solution to the initial question of the thread.
>>This code works for me. Made a comment in Command window go to next line and shows MessageBox().
>
>Right, but as I said before, it's not persistent. Put the cursor on the line after the comment and hit "Enter", and it goes away.

I don't know why, but this works :-))
Maybe becuase it executes comments as command and that way it is saved in _command.prg?
DEFINE PAD testComment OF _MSYSMENU PROMPT "Test Comment"
ON SELECTION PAD testComment OF _MSYSMENU logCommand("MESSAGEBOX('Hello, World!')")

PROCEDURE logCommand
LPARAMETERS tcCommand

SET LIBRARY TO HOME(1)+"foxtools" 

IF NOT EMPTY(tcCommand)
    lnHActive = _WOnTop()

    ACTIVATE WINDOW command 
    DoSleep(.05)

    KEYBOARD "* " + tcCommand
    KEYBOARD '{SHIFT+UPARROW}' +'{ENTER}'
    DoSleep(.05)
    _WSelect(lnHActive)

***    EXECSCRIPT(tcCommand)
ENDIF 



*!* Wait for any needed windows events to get through
PROCEDURE DoSleep

LPARAMETERS tnSeconds
LOCAL lnSeconds

lnSeconds = SECONDS()
DO WHILE SECONDS() - lnSeconds < tnSeconds
    DOEVENTS
ENDDO
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform