BASIC-SO

Commands and Statements

The example below shows a typical use of OPEN in an 110 program.See Chapter 5 for further details of disk random 110.

10OPEN "R" ,#3, "F1 :PERSON"

20GET #3,1

30FIELD #3,20 AS N$, 9 AS SS$

40PRINT N$,SS$

RUN

JONES, JOHN J. 517317010

Ok

OPTION BASE

The OPTION BASE command is used to begin indexing of arrays at 1 or O. By specifying an argument of 0 or 1, you can begin all arrays at 0 or 1. If present, OPTION BASE should precede all DIM statements and array references. If OP- TION BASE 1 is not specified, 0 is the default value.

OPTION BASE 011

OUT

The OUT statement writes the specified value to the specified 110 port. The value is an integer expression in the range 0 to 255.

OUT port number, expression

This example rings the bell on Intellec development systems using the RS-232 port.

OUTOF6H, 7

POKE

The POKE statement places the specified value into the memory location specified. The specified value is an expression that must round to an integer in the range 0-255. POKE can also accept hexadecimal and octal arguments, even though octal and hex constants over 32767 (decimal) are interpreted by BASIC-80 as negative numbers. It does this by adding 65536 to such arguments.

POKE location, expression

POKE OFFFFH, 0

POKE 65535,0

POKE 1777770,0

POKE -1,0

The instructions above set the top byte of memory to 0 in an Intellec development system having 64K of memory. Before using POKE, you should use the CLEAR command to reserve free memory. A POKE into BASIC or system code may cause BASIC or other software to fail.

6-15

Page 55
Image 55
Intel 9800758-02 manual Option Base, Out, Poke