Vidicode Argus Basic Programmers Reference Manual
Have a look at the manual Vidicode Argus Basic Programmers Reference Manual online for free. It’s possible to download the document as PDF or print. UserManuals.tech offer 9 Vidicode manuals and user’s guides for free. Share the user manual or guide on Facebook, Twitter or Google+.
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 148 If a reset occurs while no program is running, the program present in memory at the default value of PBOT will be executed. This is similar to typing RUN, except that program variables will not be reset. (c) Program running at moment of reset If a reset occurs while a program is running, program execution will halt and the error message RESET/START at line ... will be given This error cannot be trapped by an ON ERROR command. ON RESET RUN [filename] This form of the command has the highest priority, and following a reset, it will cause the specified file in User memory to be loaded at &3000 and RUN. This event has priority over modem operation and will select BASIC automatically when a RESET event happens. ON RESET RUN This form of the command has the second highest priority and is only of use when in modem-mode. It will then select BASIC and run either the !BOOT program, or, if there no such program, run the program currently loaded at PBOT. Pressing the STOP button will disable the normal ON RESET command, but will not affect ON RESET RUN [filename] or ON RESET RUN. This form of the command can only be disabled from within a program using ON RESET OFF. ON RESET ... With this form of the command the command immediately following the ON RESET is executed. This type of RESET event handler will not interrupt modem operation when a RESET occurs and will be disabled by pressing the STOP button. A program using ON RESET can be debugged by using the RESET button to simulate a reset. Remember that any program containing an ON RESET command must be executed at least once before it will respond to a RESET. When a program is to be restarted from the beginning after a reset you should use ON RESET CLEAR, in order to avoid re-dimensioning of arrays (which would otherwise cause an error). If your program also uses DATA commands, you should place a RESTORE command after CLEAR to reset the READ pointer. Examples: ON RESET PRINT RESET : RUN ON RESET OFF Syntax: ON RESET ... ON RESET OFF See also: PBOT, RESET
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 149
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 150 ON RING RING event handler The RING event lets you know when a call comes in, allowing your program time to do whatever you want it to before answering. Try entering these 3 lines: 10 ON RING SOUND 2000,100 20 REPEAT UNTIL FALSE RUN If you now disconnect your phone from your modem, and dial the number of your line from another location, your modem will RING for you! Detecting an incoming call is a background process for the modem and could disturb a running program in some cases. To disabled the detection set S-register 44 to 0 (SREG44=0). To enable again set S44 to 1. Examples: ON RING ANSWER ON RING SOUND 2000,100 ON RING OFF Syntax: ON RING .... ON RING OFF See also: ON CONNECT
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 151 ON SEQUENCE Esc. sequence event handler The escape sequence event allows you to interrupt whatever the modem is doing by use of an escape sequence. This event will only occur if the escape sequence is also enabled by SEQUENCE ON. The modem S-registers S2 and S12 also influence the escape sequence. When an escape sequence has occurred, you can read the port number where it happened from the systems variable PORT. The following short demonstration program will write characters to your terminal, but will stop doing so as soon as you enter an escape sequence: 10 ON SEQUENCE END 20 SEQUENCE ON 30 REPEAT : PRINT A; : UNTIL FALSE Examples: ON SEQUENCE MODEM ON SEQUENCE OFF Syntax: ON SEQUENCE .... ON SEQUENCE OFF See also: SEQUENCE, ON ESCAPE
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 152 ON SLASH AT scan event handler ON SLASH is used to react to the character string A/ typed at one of the serial ports and works simular to the ON AT event. The ON SLASH event will only happen if A/ is detected on a port which has been previously set to A/-scan using the command AT SLASH. When the ON SLASH event occurs, the port number of the port which received the A/ can be found in the system variable PORT. The command ON SLASH OFF will turn off the ON SLASH event, but the A/-scan on the ports set with the AT SLASH command will remain active. This command is very similar to the ON AT command. Examples: ON SLASH GOSUB Menu ON SLASH OFF Syntax: ON SLASH .... ON SLASH OFF See also: AT, ON AT, PORT
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 153 ON TIMEOUT timeout event handler ON TIMEOUT can be used to execute a particular sequence of commands at regular time intervals, and therefore provides the basis for carrying out background tasks. A single numeric parameter is used to specify the time interval in seconds from 1 to 65535. When executed, the timer will count down until the value is 0, and then reset to the original value and execute the commands which follow the ON TIMEOUT command. The end of the timeout routine is marked by a TIMEOUT END command. On completion of a timeout routine, program execution is resumed at the point at which it was interrupted. 10 ON TIMEOUT 5 PRINT CLOCK$ : TIMEOUT END 20 REPEAT 40 PUT$ GET$ 50 UNTIL FALSE Lines 20 to 40 in this example will echo all characters received at the default input port, while the timeout routine on line 10 prints the time at 5 second intervals. Timeout routines will continue to operate even after the main program terminates unless they are explicitly disabled using ON TIMEOUT OFF. This can be used in isolation at the appropriate point in the program, or it can be used in place of TIMEOUT END: 10 ON TIMEOUT 10 PRINT OK : ON TIMEOUT OFF 30 REPEAT : PRINT Looping... : UNTIL FALSE If you need to terminate program execution within a timeout routine, you must use TIMEOUT OFF (not ON TIMEOUT OFF), followed by END. 10 ON TIMEOUT 4 PRINT ok : TIMEOUT OFF : END 30 REPEAT UNTIL FALSE The TIMEOUT OFF in line 10 terminates the timeout routine, and is followed by an END command to terminate program execution. END on its own would not be sufficient, because program execution cannot end within an active timeout handler. TIMEOUT OFF will always clear the FOR-NEXT, REPEAT-UNTIL, WHILE-DO and GOSUB stacks and can also be used outside a timeout routine. TIMEOUT routines can be nested, but each time a new timeout is defined the previous one is terminated. This will terminate the original TIMEOUT command as if it were a TIMEOUT END and then take over. In the following example the first timeout will occur after 2 seconds, after which the second timeout will take 5 seconds. 10 ON TIMEOUT 2 PRINT T1 : ON TIMEOUT 5 PRINT T2 : TIMEOUT END 30 REPEAT : UNTIL FALSE ON TIMEOUT event handlers are disabled when an error is encountered in the timeout routine itself. Examples: ON TIMEOUT 60 GOTO %Tsub ON TIMEOUT 1 PRINT CLOCK$ : TIMEOUT END ON TIMEOUT Interval TIMEOUT END : GOTO %Out Syntax:
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 154 ON TIMEOUT [integer] ... TIMEOUT END ON TIMEOUT OFF TIMEOUT OFF
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 155 OPORT default output port OPORT is a system variable that defines the default output port number(s). The following commands will use the port(s) defined by OPORT if no port is specified in the command itself: ACTIVE DSR OUTPUT REPORT BAUD ESCAPE PARITY SBITS CLEAR INPUT HANDSHAKE PRINT SEND CLEAR OUTPUT INPUT PUT XOFF CTS LENGTH PUT$ XON DIR LINK RECEIVE OPORT differs from IPORT in that more than one port can be defined for simultaneous output. The correct value for OPORT can be calculated from the following table: PORT OPORT BIT OPORT VALUE 1 - Serial port 0 1 2 - Serial port 1 2 3 - Modem 2 4 6 - LCD display 5 32 7 - PRINTER 6 64 8 - BUFFER 7 128 To transmit characters one at a time from serial port 1, you could use either of the following: REPEAT PUT#1,byte UNTIL FALSE or OPORT=1 REPEAT PUT byte UNTIL FALSE Similarly, to send text to port 2 and to the printer simultaneously, you could use the following: PRINT#1,#7,Test message... but it is more efficient to use OPORT: OPORT=1+64 : PRINT Test message... Examples: OPORT=1 OPORT=135 OPORT=Port+64
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 156 PRINT OPORT Syntax: OPORT = [integer 0..255] [num-var] = OPORT See also: IPORT
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 157 ORI output ring indicator RI is the RS232 signal used by modems to indicate that an incoming ring has been detected; i.e. that a call has been received. RI is also an output from the modem on the RS232 ports. There is of course only one RI for both serial ports, because a modem can either receive a ring or not receive a ring. The RING output is controlled by the internal processes of the modem. However if you wish, you can also set the RING output yourself. In a T.C.Lite the RI output on the serial port can not be controlled! Examples: ORI OFF ORI=1 ring=ORI Syntax: [num-var] = ORI ( #[integer 1..2] ) ORI = [integer] ORI ON|OFF