INJECT Mnemonic - Set Button Response Text

Syntax

'INJECT' (id,text)

Description

The 'INJECT' mnemonic associates a string with a 'BUTTON' or 'TBUTTON' control. When that button is pushed, the text will be injected into the console typeahead buffer, where it can be read with a subsequent INPUT or READ command.

Parameter

Description

id

Control ID number. It must correspond to a 'BUTTON' or 'TBUTTON' control in the current context.

text

Text to be injected into the console typeahead buffer when this button is pushed.

Example

sysgui=unt
open(sysgui)"X0"

REM ' Create a GUI window
print (sysgui)'window'(100,100,200,200,"Inject",$0083$,$$)

REM ' Place a button control on the window
print (sysgui)'button'(101,50,50,60,20,"Inject",$$)

REM ' Define the text to be injected into the typeahead buffer
REM ' each time this button is clicked.
print (sysgui)'inject'(101,"sample")

REM ' Each time the button is clicked, text will appear in the
REM ' typeahead buffer. Print it and loop until the user ends
REM ' the program by pressing Ctrl+C in the console window or
REM ' Ctrl+BREAK in the GUI window.
while 1
input text$
print text$
wend

See Also

Mnemonics - Alphabetical Listing

Mnemonics - Group Listing