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 98 IF ... THEN ... ELSE condition test IF ... THEN ... ELSE is used to make a decision depending upon the value of a logical expression. To illustrate: 20 IF X>40 THEN GOTO 250 When this line is executed, the expression X>40 is evaluated, and if the result is true, program execution branches to line 250; otherwise execution continues at the line following line 20. In Argus BASIC the THEN clause is optional; and in fact it is more efficient to write the above example as: 20 IF X>40 GOTO 250 An IF command may not extend over more than one program line, but it is possible to nest up to sixteen IF commands in a single line. The following example illustrates two nested IFs: IF X=1 THEN IF Y>2 PRINT Ok You must be careful to ensure that the logic is correct with multiple IF commands. Examples: IF Temp > 20 THEN OLINE (1)=0 IF Inp$=Password$ PRINT Ok ELSE PRINT Illegal password IF (KEY#1=13 OR KEY#2=13) THEN %Finish Syntax: IF [expr] ( THEN ( [line-num | label] ) ) ... (ELSE ( [line-num | label] | [command] )
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 99 ILINE read input line ILINE is used to read the status of the specified input line. The Programmable Modem has sixteen possible lines for external input, numbered 1-16, which are normally configured for use as a parallel printer port and the jumper port. When one of the lines is addressed using the ILINE command, that line is automatically configured as a digital input. This line will then accept a TTL level input voltage between 0 and +5 volts. Signals between 0.8 and 2 volts will give an undefined result; signals below 0.8 volts will give logic 0, and those above 2 volts will give logic 1. The T.C.Lite has no extra external input lines and ILINE1-16 will therefor return invalid values. The ILINE command returns either 0 or 1, according to the voltage level. The status of digital I/O lines is not affected by a reset (START button or power failure). It is recommended that input signals are buffered using a suitable IC such as a 74LS244, to prevent damage to the modem due to excessive current/voltage. With the user port, jumper settings can also be seen with ILINE. ILINE will return a value of 1 if a jumper is set. Thus it is also very easy to connect additional button switches to the modem, or to monitor contacts. A special case is ILINE(0) - that is, the off-hook detect of the modem. When ILINE0 is true, either the line is busy, or the modem is not connected to a telephone line at all. If you have a telephone handset connected, we suggest that you enter: REPEAT UNTIL ILINE0 : SOUND and then pick up your phone, to demonstrate the principle. The second special case ILINE(-1) will read a random number between 0 and 255. The ILINE command is especially useful when you want to monitor equipment and send data accordingly. Examples: Switch=ILINE(2) Count=Count + ILINE(Line) PRINT ILINE15 IF ILINE16 THEN Fire-Alarm REPEAT UNTIL ILINE0=0 (waits for line to become free) Syntax: [num-var] = ILINE [integer -1..16] See also: OLINE
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 100 INPUT read string/number INPUT is used to read string or integer values from ports #1 to #3. A prompt message may be included in the command, and input is terminated when a [CR] is received. A port number can be specified, but if this is omitted the default input port as defined by IPORT will be assumed. The following example displays a prompt message, and then waits for the user to enter some data and press [Return]: 50 INPUT Enter a number :; Num A question mark is automatically appended to the prompt message, and the number, when entered, is stored in the integer variable Num. One or more Line-feeds may be inserted before the prompt message by preceding it with the requisite number of single quote marks: 50 INPUT Enter a number :; Num Here, two blank lines are printed before the prompt message. Multiple values may be read using a single INPUT command, and each of these may have its own prompt string: 60 INPUT First name : ; FName$; and Surname :; SName$; Here, two string variables, FName$ and SName$, are read using INPUT. The prompt for the SName$ is not displayed until the user has entered his first name and pressed [Return]. If individual prompts are not required, commas can be used to separate variables: INPUT Enter three numbers : ; X,Y,Z A question mark will be printed after the prompt message, and the user may type all three items on the same line separated by commas; or alternatively, on separate lines by pressing [Return] after each. In the latter case a ? will be printed to prompt for each value. Invalid input When reading a numeric variable, invalid input (i.e. numbers out of range, non numeric characters, etc.), will result in the variable being assigned a value of 0. Valid characters appearing at the start of an input line will be accepted. For example, entering: 56afg in response to a prompt for an integer, would result in the variable being assigned the value 56. Pressing [Return] on its own in response to a prompt for a string variable will assign a null string to the variable; i.e. a string with no characters. A special case is INPUT ALL. INPUT ALL will accept all data received until a carriage return is received, inclusive of control characters and leading spaces. Another special case is INPUT AT (SLASH). When this command is executed the following will happen: • The user can enter an AT command (and optionally also A/). • The command will be passed transparently to the modem. • The command will be executed by the modem. • The result will be printed to the screen.
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 101 • The result code will be stored as an integer in the systems variable RESULT. This is the same as leaving BASIC to give just one command to the modem. Examples: INPUT X INPUT#3 Name ;Na$ INPUT ID Number ; Id; Password : ;Pword$ INPUT#2 Time : (HH MM SS) ,Ho, Mi, Se INPUT ALL Screencode ;S$ INPUT AT SLASH Syntax: INPUT ( #[port], ) (ALL) () (prompt) (,) (;) [num- var]|[string- var]... INPUT AT (SLASH) (,#[port]) See also: CLEAR, ECHO, PRINT
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 102 IPORT default input port IPORT is an important system variable that defines the default input port number. The following commands use the value of IPORT as the default port when no port is specified: ACTIVE DTR KEY RTS AT GET KEY$ SEND CTS GET$ MATCH DCD INPUT ORI DSR IRI RECEIVE Thus to read characters one at a time from port 1 there are two options: Byte=GET#1 or IPORT=1 : Byte=GET The second method is more efficient when repeated input from the same port is necessary. IPORT will operate on the following ports: Port 1 is serial port 1. Port 2 is serial port 2 (called Aux on a T.C.Lite). Port 3 is the modem (telephone line). Port 6 is the keyboard (if available). Port 7 is the parallel printer port. Port 8 is the user/memory buffer (see BUFFER command). Examples: IPORT=2 IPORT=Port Inp=IPORT Syntax: IPORT = [port] [num-var] = IPORT See also: OPORT
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 103 KEY get byte (no wait) KEY is used like GET, to read a byte from a serial input buffer. Unlike GET, KEY does not wait for data to become available, but will a return a 0 if the input buffer is empty. A port number may be specified, but if this is omitted the default input port as defined by IPORT will be assumed. Examples: Keystroke=KEY X=KEY#2 IF KEY#3 THEN 1000 Syntax: [num-var] = KEY ( #[port] ) See also: GET, GET$, KEY$
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 104 KEY$ get character (no wait) KEY$ is used like GET$ to read a character from a serial input buffer. Unlike GET$, KEY$ does not wait for data to become available, but will return a null string if the input buffer is empty. In this respect, GET$ is useful for checking whether or not the input buffer is empty - GET cannot be used because there may be [Ctrl-@] characters in the input buffer which would appear as ASCII 0. A port number may be specified, but if this is omitted the default input port as defined by IPORT will be assumed. Examples: Ch$=KEY$ REPEAT UNTIL KEY$#3=E IF KEY$= THEN %Wait Syntax: [string-var] = KEY$ ( #[port] ) See also GET, GET$, KEY
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 105 LCASE convert ASCII to lowercase LCASE is used to calculate the lower case ASCII value of a character. Examples: PRINT LCASE 65 B=LCASE66 Syntax: [num-var] = LCASE [num] See also: LCASE$, UCASE, UCASE$
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 106 LCASE$ convert string to lowercase LCASE$ is used to convert all characters in a string to lower case. Characters that are already in lower case remain unchanged. This command (or UCASE$) is frequently needed to standardize keyboard input. Examples: PRINT LCASE$ QwErTy result$ = LCASE$ input$ Syntax: [string-var] = LCASE$ [string] See also: LCASE, UCASE, UCASE$
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 107 LED control LEDs LED is used to control the LEDs on the front of a Programmable Modem (if fitted). The T.C.Lite never has LEDs fitted. You can control all user and other modem LEDs, except the POWER LED. LED0 - BUSY LED1 - USER LED1 LED2 - USER LED2 LED3 - USER LED3 LED4 - USER LED4 LED5 - USER LED5 LED6 - AA LED7 - DCD LED8 - OL LED9 - S/A LED10 - CTS LED11 - DTR Normally you will turn the LED on by making it equal to a non-zero number, and turn it off by making it equal to 0 again. LED8 is a bit different, because it is connected via hardware to the on-line relay of the modem. It will operate in reverse and will also influence the relay. We therefore recommend that you do not normally control LED8 from within your programs. Normally the modem itself controls the User LEDs, so to have them under program control, you will first have to disable control by the modem. From within the BASIC environment: AT *L0 or SREG32=0 (LEDs 1 till 5 off) The User LEDs (LED1-LED5) can also be set with SREG32: bit0=LED1 - bit4=LED5. So, SREG32=10 will turn on LEDs 2 and 4 and turn off LEDs 1, 3 and 5. Examples: LED2 ON LED3=1 LEDUser=A IF LED6 PRINT Auto Answer LED is still on! PRINT LED4 Syntax: LED[num] ON|OFF LED[num] = [num] [num-var] = LED[num]