Home > Vidicode > Communications System > Vidicode Argus Basic Programmers Reference Manual

Vidicode Argus Basic Programmers Reference Manual

    Download as PDF Print this page Share this page

    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 
    108
      
    LEFT$    extract left part of a string 
    LEFT$ extracts the specified number of characters from the left-hand side of a string.  The command: 
    L$=LEFT$(ABCDEFGH,3)
    will assign the string ABC to the string variable A$. 
     
    The number of characters extracted must be between 0 and 255.  Attempts to extract more characters than exist in the string 
    will return the entire string. 
    Examples: 
    Firstname$=LEFT$(Name$,6)
    Da$=LEFT$(CLOCK$,2)
    PRINT LEFT$(Now is the time for all good men.., 10)
    Syntax: 
    [string-var] = LEFT$ ( [string], [integer
    0.255] )
    See also: 
    LEN, MID$, RIGHT$
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    109
      
    LEN    get length of string 
    LEN returns the length of the specified string, including spaces and non-printing characters. 
    Examples: 
    Size=LEN(Name$)
    IF LEN(Name$) >30 THEN PRINT Name too long ..
    PRINT LEN(Message$)
    Syntax: 
    [num-var] = LEN( [string] )
    See also: 
    LEFT$, MID$, RIGHT$
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    110
      
    LENGTH    set or read serial port word length 
    The LENGTH function is used to set or read the number of data bits used during serial data transfer. 
     
    The number of bits used can be specified separately for each port, and may be set to 7 or 8 bits.  The most common format 
    for ASCII systems is 8 data bits, no parity and 1 stop bit, which is the default format used by this modem.  This format must 
    be used for sending data or machine language programs using the Xmodem protocol. 
     
    If a user is connected to another terminal configuration, you might want to advise the other person that he will not be able to 
    see what the application is expecting him to see, so it is very useful to read LENGTH at a certain stage in your program. 
     
    After pressing the STOP button, the length for all ports will be configured to the default value of 8 bits. 
     
    If no port is specified, the default output port as defined by OPORT is assumed. 
    Examples: 
    LENGTH 7
    LENGTH#1,#2,#3,8
    LENGTH#Port,Bits
    IF LENGTH=7 GOSUB %WARNING
    Syntax: 
    LENGTH ( #[port] ) (, #...) [integer 5..8]
    See also: 
    BAUD, PARITY, SBITS
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    111
      
    LINEFEED    enable/disable Line Feeds 
    Most terminals and printers accept a combination of Carriage Return (ASCII 13) and Line Feed (ASCII 10) characters to 
    indicate the end of a line, while others require only a Carriage Return, and insert a Line Feed automatically.  The 
    LINEFEED command is used to switch Line Feeds on or off, as appropriate. 
     
    LINEFEED ON causes the modem to insert a Line Feed after every Carriage Return in a transmitted data stream for the 
    specified port. 
     
    LINEFEED OFF disables transmission of Line Feeds for the specified port. 
     
    If no port is specified, the default port as defined by OPORT will be assumed. 
     
    With respect to the printer port (#7), there are two forms of the command that may be used: 
    LINEFEED#7, ON/OFF
    or 
    PRINTER LINEFEED ON/OFF
    There is a second syntax of LINEFEED. 
    LINEFEED [num-var].
    This command allows you to change the ASCII value of the linefeed character, which is normally set to the default value of 
    10. 
    Examples: 
    LINEFEED ON
    LINEFEED#2,#3,OFF
    LINEFEED#7,ON
    LINEFEED 10
    Syntax: 
    LINEFEED ( #[port] ) (, #...) ON/OFF
    LINEFEED (=) [num]
    See also: 
    PRINTER
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    112
      
    LINK    connect logical data streams 
    LINK is used to create transparent links between two serial ports. 
    The advantage of linking ports can be explained with the following example. 
     
    Assume that a terminal is connected to port 1, and a computer to port 2, and that both are set for 9600 baud operation.  
    There are various ways of connecting the two devices.  The first is to write a program that simply takes characters from each 
    port and puts them to the other: 
    10 BAUD#1,#2,12
    20 REPEAT
    30 PUT#2,KEY$#1
    50 PUT$#1,KEY$#2
    60 UNTIL FALSE
    Unfortunately however, this short loop ties up the modem permanently, so that no other operation can be carried out.  
    Furthermore, Argus BASIC, though fast, is not fast enough to keep up with two 9600 baud data streams, and software or 
    hardware handshaking must be used to prevent loss of data. 
     
    The alternative is to use the LINK command: 
    10 BAUD#1,#2,12
    20 LINK#1,#2
    30 LINK#2,#1
    40 REM - Remainder of program starts here
    Here, the two LINK commands are used to establish a bi-directional, transparent link between ports 1 and 2.  Such a link 
    will not interfere with the rest of the program, and will remain effective even when program execution ceases. 
     
    You may ask whether it would be simpler to couple the terminal direct to the computer using an appropriate cable.  In this 
    example that is probably the case, but there are situations where this is not practical; e.g. when the data format of the two 
    devices is different.  With LINKed ports: 
    •  the baud rate and data format of the linked devices need not be the same. 
    •  it is possible to monitor the data flow and respond to specified character 
     sequences. 
    •  data flow can be switched between different ports. 
    •  incoming data can be routed to one or more output ports. 
    Data monitoring carried out using the INPUT, GET, KEY and MATCH commands can be extremely useful, but will slow the 
    link down.  A further command is therefore provided to enable handshaking over the link: 
    HANDSHAKE LINK ON
    This will prevent loss of data due to buffer overflow. 
    HANDSHAKE LINK OFF
    may be used to disable handshaking if speed is not likely to cause problems. 
     
    The next example program uses the MATCH command to monitor the link for the string PASSWORD being received at port 
    1: 
    10 LINK#1,#2 
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    113
      
    20 LINK#2,#1
    30 HANDSHAKE#1 LINK ON
    40 HANDSHAKE#2 LINK OFF
    50 MATCH#1, PASSWORD
    60 ...
    Note that the first port number specified in the LINK command is that of the input port.  One or more output ports then 
    follow: 
    LINK#1,#2,#7
    Here port 1 is the input port; ports 2 and 7 are outputs. 
     
    The following will create a bi-directional link between ports 2 and 3 while allowing port 1 to monitor data received via port 2: 
    LINK#2,#3,#1
    LINK#3,#2
    A port can also be linked to itself: 
    LINK#1,#1
    The effect of this is to provide character echo. 
     
    If no port numbers are specified, the default input port defined by IPORT will be used as the input port, and the default 
    output port defined by OPORT as the output port. 
     
    The command: 
    LINK OFF
    may be used to disconnect linked ports.  Pressing RESET will clear the input and output buffers, and also terminate any 
    existing links. 
     
    Port 6 (keyboard and LCD display) can not be linked. 
    Examples: 
    LINK#1,#2
    LINK PORT2,PORT7
    LINK#1,#2,#3
    LINK#In,#Out
    LINK PORT8,PORT1
    LINK OFF
    Syntax: 
    LINK ( #[port] (TO|,) (#[port] ) (, ...)
    LINK OFF
    See also: 
    HANDSHAKE 
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    114
      
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    115
      
    LIST    list BASIC program 
    LIST is used to list the currently loaded program to the specified port. 
     
    When used without a parameter, the entire program will be listed to the default output port as defined by OPORT. 
     
    A range of line numbers can be specified; thus the following example will only list those lines from 500 to 1000 inclusive: 
    LIST 500,1000
    To list from the start of the program up to a specific line number, just omit the first parameter; e.g. to list all lines up to and 
    including line 300 you would use: 
    LIST , 300
    Output is normally formatted so that: 
    •  BASIC keywords are translated to upper case 
    •  variable names have their first letter capitalized 
    •  spaces are inserted to make programs more readable 
    •  conditional commands such as IF, REPEAT, etc. are indented. 
    The formatting feature can be enabled or disabled, using the commands 
    LIST OFF and LIST ON respectively. 
     
    There are a number of ways in which LIST can be used to obtain a printed copy of a program.  The first is to specify port 
    number 7 which is the parallel printer port (assuming you have a printer attached): 
    LIST#7
    Alternatively, you may use the PRINTER ON command, followed by LIST. 
     
    Yet another option is to set OPORT to 65 before printing. 
     
    A very useful variant of LIST is the LIST AUTO command which is used for capturing programs that are going to be 
    edited. 
    Examples: 
    LIST#7,500
    LIST 70,150
    LIST Label1 TO Label2
    LIST OFF
    Syntax: 
    LIST ( #[port])(,#...) (line-num | label ( TO|, ) line- num |
    label)LIST ON | OFF
    See also: 
    OPORT, PRINTER ON/OFF
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    116
      
    LIST AUTO    list program for editing 
    This is used to capture a special listed program for editing. 
     
    This command lists programs without line numbers included.  Programs captured in this way can be edited offline and ASCII 
    uploaded back to the modem using the AUTO command. 
     
    When performing an ASCII upload to the modem, the AUTO command will automatically assign numbers to program lines. 
    Syntax: 
    LIST AUTO
    See also: 
    AUTO, LIST
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    117
      
    LOAD    load BASIC program or data 
    The principal use of LOAD is to copy programs from disk into program memory, at the location specified by the system 
    variable PBOT. 
     
    To load from the disk, use LOAD (followed by an optional exclamation mark) and the filename within double quotes: 
    LOAD DIAL.PROG
    By changing the value of PBOT it is possible to LOAD a number of programs into memory at once: 
    LOAD Prog1
    Base1=PBOT
    PBOT=PTOP+2
    Base2=PBOT
    LOAD Prog2
    By manipulating the value of PBOT one program can then call another.  Each program loaded in this way will have access to 
    the same variables; i.e. the variable Name$ in one program will be the same in another, so that all variables are global. 
     
    The second use of LOAD is to copy DATA from the disk to a certain address.  In this case you have to specify the address. 
    Examples: 
    LOAD Prog$
    LOAD &4000, MODEM.PROG
    LOAD &6800, Bytes$
    LOAD !SETUP.PROG
    LOAD FILE SETUP.PROG
    Syntax: 
    LOAD (!|FILE)(address)[string]
    See also: 
    RUN, SAVE
      
    						
    All Vidicode manuals Comments (0)