The poke BASIC program sends either a string of characters or one or more TCL commands to the input buffer of another port.
For Windows: Not Supported.
poke port.number{,{text}} poke port.number{}esc{file.reference {item-ID}} poke port.number esc poke port.number tcl.commands esc{tcl.commands{esc}...}
port.number | Designates the target port number. |
text | Contains any characters, except segment marks (x'ff'), and can be unlimited in length. The text can be preceded by a space, which optional. When the text is omitted, a carriage return is sent to the target port. The text string can be enclosed in single or double quotation marks, or backslashes. |
One or more TCL commands may be sent directly to the target port. Each TCL command must be followed by an escape, which is treated as a carriage return on the receiving port.
An item containing one or more valid TCL commands may also be transmitted directly from a file. The transmitted item must contain one valid TCL command on each attribute. This feature is accomplished by poking an escape to the target port. The process prompts for the file name and item-ID of the item to transmit and execute.
The poke command displays the number of characters it has successfully poked to the target port’s input buffer. The number reported may not match the actual number of characters sent due to the condition of the target port’s input buffer.
The ESC key is used by poke to terminate commands, a special provision applies for transmitting an actual escape. This is accomplished by pressing ESC twice. A set of two escapes is treated (and poked) as one escape.
Sends a carriage return to port 16.
poke 16 [1028] 1 characters poked.
Sends a carriage return to port 16.
poke 16, [1028] 1 characters poked.
Sends the string, "answer the phone!", to port 16, without following the (poked) string with a carriage return.
poke 16,answer the phone! [1028] 17 characters poked.
This is exactly the same as the previous example. Single or double quotation marks and backslashes have no effect on the string being sent, unless the string happens to begin with, but not be followed by, a literal quotation mark. See the next example.
poke 16,"answer the phone!" [1028] 17 characters poked.
Fails because the string is preceded by a quotation mark.
poke 16 "hi [2] Uneven number of delimiters (’ " \).
The next example shows that a trailing quotation mark is accepted.
poke 16 hi" [1028] 3 characters poked.
Embedded quotation marks are permitted.
poke 16,don’t panic! [1028] 12 characters poked.
In all of the previous examples, no carriage return was entered at the end of the poked strings.
In this form of a poke, the string being sent is an actual TCL command. The [ is echoed by pressing ESC. This pokes a who to port 16 and issues a carriage return to process the command.
poke 16 who[
This pokes the who, time, and ovf commands to port 16 and executes them.
poke 16 who[time[ovf
This form uses the port number, followed by pressing ESC, and then ENTER. The process prompts for the file name and item-ID of the item to transmit.
poke 16[ poke from file-name item-name:md script1
Each attribute of the specified item, starting at the first attribute, is treated as a valid TCL command. For example, script1 could look like this:
id: script1 att 1: who att 2: time att 3: ovf
The file name in this example is supplied on the command line. The process only prompts for the item-ID of the item to transmit.
poke 16[md poke from item-name:script1
The file name in this example and item-ID are specified on the command line.
poke 16[md script1 [1028] 13 characters poked.
In this form, an item is constructed on-the-fly, then poked into the target port’s input buffer. This example executes the who, time, and ovf commands on port 16.
poke 16[ poke from file-name item-name:[ 0001 :who 0002 :time 0003 :ovf 0004 [1028] 13 characters poked.
Pokes two ESC key results in one escape being sent.
poke 16 [[ [1028] 1 characters poked.
Illustrates using execute to poke characters to another port. This instruction pokes a CTRL+X, then a CTRL+E, followed by a literal "y". This explicitly exits the receiving port from the current item in the Update processor.
execute "poke 16 " : char(24):char(5):"y"