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:
01141339
Views:
17
>>I'm trying to write text into the Command window to log menu selections, similar to the way the
>>SourceSafe integration does. I've got everything working except for one thing: it isn't persistent.
>>When I try to KEYBOARD "{ENTER}" to commit the comment, it does nothing (except
>>scroll up one line). I recognize this behavior from all-too-frequent occurences of trying to
>>type "CANCEL" in the command window to clear the current READ EVENTS.
>
>How do you put comments into the command window? Can you post your code?

Something like this.
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 + "{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
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform