-------------------------
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
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
-----------------------