Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve text in command window?
Message
De
02/11/2001 08:48:32
 
 
À
02/11/2001 07:22:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00576251
Message ID:
00576651
Vues:
18
Glenn,
As I mentioned to Sergej, this doesn't work for me.

>I believe code in the following vein will do the trick:
>
>lclastwind = wontop()
>keyboard "{ctrl+f2}"+"{pause .1}"+"{ctrl+A}"+"{pause .1}"+"{ctrl+c}"+"{pause .1}"+"{ctrl+end}{pause .1}"
>activate window (lcLastWind)
>
>
>Now the contents of the command window is in _cliptext
>
>Glenn
>
>>Christian,
>>AFAIK, there's no way to get the text of the command window with standard VFP code. As you've noticed, the command window is not available when you run a program and/or macro. The only workaround I found is to use the editor functions from FoxTools. I used something like the following to log the content of the command window to a table before VFP7:
>>
>>*-- get the text from the command window
>>
>>*-- make sure FoxTools is loaded
>>IF NOT "FOXTOOLS" $ SET("LIBRARY")
>>	IF FILE("FOXTOOLS.FLL")
>>		SET LIBRARY TO FOXTOOLS ADDITIVE
>>	ELSE
>>		MESSAGEBOX("Cannot find FoxTools.fll. Cannot log command window", 16)
>>		RETURN ""
>>	ENDIF
>>ENDIF
>>
>>lnWhandle = _WFindTitl("Command")
>>
>>IF lnWhandle = 0
>>	MESSAGEBOX("_WFindTitl returned 0. Cannot log command window", 16)
>>	RETURN ""
>>ENDIF
>>
>>DIMENSION laEnvironment[25]
>>
>>IF _EdGetEnv(lnWhandle, @laEnvironment) = 0
>>	MESSAGEBOX("_EdGetEnv failed. Cannot log command window", 16)
>>	RETURN ""
>>ENDIF
>>
>>lcCommandHistory = _EdGetStr(lnWhandle, 0, laEnvironment[2])
>>
>>RETURN lcCommandHistory
>>
>>
>>George Tasker has created an excellent help file for FoxTools that covers functions that are not documented in the standard FoxTools help. I believe you can find it in the download section.
>>
>>HTH
>>
>>>Hello,
>>>
>>>I try to get the text that I have typed in the command window because I want to use it for several development tools.
>>>I know that when I quit VFP, the text that I typed into the command window will be stored to the file _Command.PRG. But until I quit, the text is not stored in any file I found so far. There are some temporary files in the windows temp directory but they are all locked while VFP is open.
>>>
>>>I also tried something like this:
>>>KEYBOARD "{SHIFT+UPARROW}"
>>>KEYBOARD "{SHIFT+UPARROW}"
>>>KEYBOARD "{SHIFT+UPARROW}"
>>>
>>>and then, smart as I am:
>>>KEYBOARD "{CTRL+C}"
>>>
>>>But this won't copy the highlighted text.
>>>
>>>Is there another way, or shall I just forget about it?
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform