Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pushing the keyboard
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Pushing the keyboard
Miscellaneous
Thread ID:
00757825
Message ID:
00757825
Views:
35
-------------------------
I have another puzzle that looks like it should have a simple solution but I haven't found it yet.

I have an EditBox that responds (KeyPress) to the user pressing F2-F9, F11, or F12, by inserting predefined user-defined text. I didn't realize at the time that KEYBOARD only accomedates 128 characters...I personally never needed more that a handfull... but now my user is trying to assign more than 128 characters to one of the F-keys.

I thought it would be easy enough to solve by spliting the text up and making multiple passes thru KEYBOARD...but it doesn't work...Keyboard is waiting for a time of possible user input before it "types" it's stuff into the edit region.
Below is my first failed approach...
nPhraseLength = LEN(ALLTRIM(phrase))
IF nPhraseLength <= 128
	KEYBOARD ALLTRIM(phrase)+" "
ELSE
	*phase is long so loop thru until done
	FOR nCnt = 1 TO nPhraseLength STEP 128
		cPhrase = SUBSTR(phrase, nCnt, 128)
		KEYBOARD ALLTRIM(cPhrase)
	ENDFOR
ENDIF
I can't just append the text to the current content because the user may want to insert the text into the middle of an existing sentence.

Next, I thought I could use the clipboard to hold the text and then use KEYBOARD to paste it, but I don't seem to have the syntax right.
Below is my second failed approach.
_CLIPTEXT = ALLTRIM(phrase)+' '
KEYBOARD {CTRL+V}
Is this a good approach?
If so, what's the correct syntax?
If not, how would you do it?

TIA,
Rick
-----------------------
Next
Reply
Map
View

Click here to load this message in the networking platform