o,... ,... It) IBM 5110 Basic Reference,Manual

Size: px
Start display at page:

Download "o,... ,... It) IBM 5110 Basic Reference,Manual"

Transcription

1 _ IBM 5110 Basic Reference,Manual,...,... It)

2 Preface This manual cntains specific infrmatin abut the IBM 5110 Cmputer and its BASIC prgramming capability. Prerequisite Publicatin IBM 5110 BASIC Intrductin, SA Related Publicatins IBM 5110 BASIC User's Guide, SA IBM 5110 BASIC Reference Handbk, GX IBM 5110 Custmer Supprt Functins Reference Manual, SA First Editin (January 1978) Changes are cntinually made t the specificatins herein; any such changes will be reprted in subsequent revisins r Technical Newsletters. Requests fr cpies f IBM publicatins shuld be made t yur IBM representative r the IBM branch ffice serving yur lcality. A Reader's Cmment Frm is at the back f this publicatin. If the frm has been remved, address yur cmments t I BM Crpratin, Publicatins, Department 245, Rchester, Minnesta Cmments becme the prperty f IBM. I 01 Cpyright Internatinal Business Machines Crpratin 1978

3 _.._ l) Cntents C~_) C) Character l/' CHAPTER 1. OPERATION Arrays. 61 IBM 5110 Overview Declaring Arrays 62 Display Screen 2 Redimensining Arrays 63 Keybard 3 Arithmetic Arrays. 63 Special Keys. 7 Character Arrays 64 Switches. 9 Summary f Naming Cnventins 64 Indicatrs 9 System Functins. 65 Editing Input Lines 10 Expressins 67 Strage Capacity 11 Arithmetic Expressins and Operatrs. 67 Expressins 70 CHAPTER 2. SYSTEM COMMANDS 13 Substring Functin 71 Device Address Parameter 14 Cncatenatin 72 File Reference Parameter 14 Relatinal Expressins 72 ALERT Cmmand 16 Array Expressins 73 AUTO Cmmand 17 Data Files and Access Methds. 74 CSKIP Cmmand 19 Stream I/O Data Files 74 GO Cmmand 20 Recrd I/O Files 74 LINK Cmmand. 22 Recrd I/O File Buffer Requirements 78 LIST Cmmand 23 File FLS 79 LOAD Cmmand 25 Natinal Character Sets 83 Keybard Generated Data Files 28 Prcedure File 84 Functin Keys 28 MARK Cmmand'. 31 CHAPTER 4. BASIC STATEMENTS 87 MERGE Cmmand 33 Statement Lines 87 PROC Cmmand 35 Desk Calculatr Operatins 88 RD= Cmmand 36 BASIC Statement Listing 88 RENUM Cmmand 37 CHAIN. 90 REWIND Cmmand 38 CLOSE. 92 RUN Cmmand. 39 DATA 93 SAVE Cmmand 41 DEF, RETURN, FNEND 95 SKI P Cmmand. 43 Single Line Functin 95 UTI L Cmmand. 44 Multiline Functin 96 Listing a File Directry 45 DELETE FILE 99 File Types. 47 DIM. 100 Renaming a File n Diskette 48 END. 102 Changing A Diskette Vlume ID 49 EXIT 103 Eliminating r Discntinuing a File 50 FNEND 105 Assigning r Remving File Write Prtectin fr Diskette FOR and NEXT 106 Files. 51 FORM 108 Selecting the Diskette Srt Feature. 52 Print Frmatting with the FORM Statement 108 Changing the System Default Device Address 52 Recrd Frmatting with the FORM Statement 114 (~, [MAT] GET. 122,,---,) CHAPTER 3. DATA CONSTANTS, VARIABLES, AND GOSUB and RETURN 124 CONCEPTS. 53 GOTO 126 BASIC Character Set 53 IF. 127 Alphabetic Characters. 53 Image 129 Numeric Characters. 53 [MAT] INPUT. 130 Special Characters 54 LET 132 Cr.., Use f Blanks 54 NEXT 134 " I Arithmetic Data 55 ONERROR 135,---j Arithmetic Data Frmats 56 OPEN/OPEN FILE. 137 Arithmetic Cnstants 58 PAUSE 142 Internal Cnstants 58 [MAT] PRINT. 143 Internal Variables. 59 Print Znes 144 Arithmetic Variables 59 Spacing f Printed r Displayed Values 144 C) Character Data 59 Standard Output Frmats fr Printing r Displaying. 145 Character Cnstants 60 Display Line Operatin 146 Character Variables. 60 Print Line Buffer Operatin 150 iii

4 [MAT] PRINT USING and Image/FORM Cnversin f Data Reference Values with Image Frmat Specificatins [MAT] PUT... [MAT] READ.... [MAT] READ FILE.. [MAT] REREAD FILE REM RESET [FILE] RESTORE. RETURN.. [MAT] REWRITE FILE STOP.... USE.... [MAT] WRITE FILE Matrix Operatins. MAT Assignment Statements MAT Assignment (Scalar Value) MAT Assignment (Simple)... MAT Assignment (Additin and Subtractin) MAT Assignment (Matrix Multiplicatin) MAT Assignment (Scalar Multiplicatin) MAT Assignment (Identity Functin).. MAT Assignment (Inverse Functin).. MAT Assignment (Transpse Functin) MAT Assignment (Ascending Index). MAT Assignment (Descending Index). CHAPTER 5. MORE INFORMATION ABOUT YOUR SYSTEM BASIC Cmpatibility with IBM 370/VS BASIC. BASIC Cmpatibility with IBM 5100 BASIC Tape Cartridge Handling and Care. Strage Cnsideratins Diskette Handling and Care Operatin... " Handling Defective Cylinders. Handling Precautins. Strage.... Shipping and Receiving "'" APPENDIX A BASIC CHARACTERS AND HEXADECIMAL REPRESENTATION 209 APPENDIX B PRINTER Hw t Insert Frms Cntinuus Frms.... Frms Path fr Singlepart Frms Frms Path fr Multipart Frms Cut Frms.... Hw t Adjust the Cpy Cntrl Dial fr Frms Thickness Hw t Replace a Ribbn (Part Number ) Installing the 5103 Printer Stacker APPENDIX C HEXADECIMAL REPRESENTATIONS ",,--, "... _... APPENDIX D. BASIC ERROR MESSAGES AND OPERATOR RECOVERY 223 I/O Errrs Executin Errrs 227 APPENDIX E. ATTACHING A TV MONITOR 241 iv

5 ... _.'--_.,----- _.._.".,--._."_... ",,,, C) IBM 5110 OVERVIEW The IBM 5110 Mdel 1 (Figure 1) is a cmputer designed fr direct l;ise by the user fr slving prblems. The 5110 Mdel 1 has a display screen, a cmbined alphameric and numeric keybard, a tape unit, switches, and indicatr lights. The 5110 Mdel 2 is identical t Mdel 1 except that it has n built-in tape unit. The display screen and indicatr lights cmmunicate infrmatin t the user, and the keybard and switches allw the user t cntrl the peratins the system will perfrm. Figure 1 shws a cmbined BASIC/ APL Chapter 1. Operatin PROCESS IN PROCESS Indicatr REVERSE DISPLAY Switch BASIC/APL Switch Switch DISPLAY REGISTERS/NORMAL Switch Display Screen CMD Key L ~~:::1.1 JU J.--I-H-.f---- Ar ith metic Operatr Keys C) Shift Keys EXECUTE Key Figure 1. The IBM 5110 Cmputer Operatin

6 ... DISPLAY SCREEN The display screen (Figure 2) can display 16 lines f data at a time, with up t 64 characters in each line. Input data (infrmatin supplied by the user) as well as utput data (prcessed infrmatin) is displayed. The bttm line cntains status infrmatin. The number in the lwer right (NNNNN) indicates the number f character psitins (bytes) in strage available t the user. Line 1 (input line) cntains infrmatin entered frm the keybard. The cursr (flashing hrizntal line) indicates where the next input frm the keybard will be displayed. If the cursr is mved t a psitin that already cntains a character, that character flashes, As BASIC prcesses the input, all lines f the display (except the bttm line) are mved up s infrmatin can be entered n line 1 again. The number fllwing NNNNN in the lwer right (001) identifies the current cursr psitin relative t the start f the input. This number can be up t 896 (14 lines f 64 each). '-. \..., Line I ~' Character Psitins ~, I Numbers ~ Cursr (flashing) Status Line READY NNNNN Figure 2. The 5110 Display Screen Frmat 2

7 C) C -\ ) KEYBOARD The APL/BASIC system keybard (Figure 3) cmbines alphameric and numeric characters. The keybard prvides tw mdes f character keying selectin: standard BASIC character mde and lwercase character mde. When yu turn the system pwer n, yu are in standard BASIC character mde. In standard BASIC character mde, yu can enter uppercase alphameric characters (withut using the shift key), the uppercase symbls (using the shift key), the BASIC statement keywrds (n the frnt f the alphameric keys), and BASIC cmmands (abve the tp rw f numeric keys) using the CMD key. In lwercase character mde, yu can enter lwercase (withut using the shift key) and uppercase (using the shift key) alphameric characters, alng with the uppercase symbls (selected using the CMD key). In lwercase character mde, yu cannt select the BASIC statement keywrds because the CMD key is used t select uppercase symbls. T select lwercase character mde, press the HOLD key, then hld dwn the shift key while yu press the scrll dwn'" key. T return t standard BASIC character mde, press the HOLD key, then hld dwn the shift key while yu press the scrll up t key. Operatin _.. --_.._..-_..._...._------_._-_._--_.--_._-_._ _-----

8 The fllwing examples shw the use f standard BASIC character mde and lwercase character mde. In standard BASIC mde, press: t enter the character K. \. t enter the charaacter ' (single qutatin mark). /"-..., ( \...,._... t enter the keywrd PAUSE. In lwercase character mde, press: t enter the character k.,,,--... (, \,..... t enter the character K. t enter the character' (single qutatin mark). r... \ "--'-' Nte: All the examples in this manual are in standard BASIC character mde.., I \,...-' 4

9 Yu can enter numeric data cnveniently by using the calculatr arrangement f numeric keys t the right f the alphameric keys. Yu can als enter this data by using the numeric keys abve the alphameric keys. The arithmetic peratr keys, lcated n the right f the keybard, are als n the alphameric keys. Nte that n a BASIC-nly keybard (Figure 4) upper shift APL symbls abve the alphameric characters can be entered as data, even thugh they d nt appear n the BASIC keybard. When any f the keys are pressed, the characters entered appear in the input line n the display screen. BASIC statement keywrds are printed n the frnt f the alphameric keys. These wrds are entered starting at the current cursr psitin when the CMD key is held dwn and the crrespnding key is pressed (in standard BASIC character mde). Operatin 5

10 CD CD CD CD OJ CD CD OJ CD OJ CJ CD D" QJCDCDCDCDCO(I)OJCDCD~O CJGJ80 CO CO CD GJ CD CD CJ [J (I) CD OJ CD [J GJ GJ [?- _ GJCDCIJwCDCDITJ[]CJCDCIJ _ OCJD 0 ( 0 )0 [] Figure 3. Cmbined BASI,C/ APL Keybard [] [J CD CD OJ CD CD OJ GJ [J CJ 0.:---~: CD GJGJGJ GJCOGJCJGJCDOO Q GJ [J GJ GJ GJ [J [J [J CD OJ CD CJGJ8 CJ [J GJ GJ 0 - GJGJGJGJGJGJITJ[]CJQCIJ _ OCJD 0 ~ - ( ( 0 )0 [] Figure 4. BASIC-Only Keybard '- 6

11 c:) Special Keys The fllwing keys have special functins relating t system peratins: (Attentin)-Yu can press the ATTN Key t stp system peratins. While yu are entering data at the keybard, yu can press the ATTN key t blank everything frm, and including, the cursr psitin t the right n the input line f the display screen. If the display is in use as an input device, the ATTN key will blank everything t the right and belw the cursr psitin. Yu can then cntinue entering infrmatin. In additin, the ATTN key and the HOLD key are the nly keys that are active when the display screen flashes t indicate detectin f an errr. After yu press the ATTN key t stp the flashing display screen, all keys are active and yu can prceed. The ATTN key must als be used (after the audible alarm has sunded) t resume prcedure file peratins. (Cmmand)-When yu hld dwn the CMD key, yu activate the tp rw f alphameric keys, which cause the cmmand keywrd t be inserted n the input line when the number belw the wrd is als pressed. The cmmand peratin is executed when yu press the EXECUTE key. The CMD key is als used with the numeric keys (n the right side f the keybard) t initiate keys functins. Avid hlding dwn the CMD key and pressing the HOLD key; this activates a functin restricted t use by service persnnel. Hlding dwn the CM 0 key (in standard BASIC character mde) and pressing a key with a BASIC statement keywrd n the frnt will enter the keywrd beginning at the current psitin f the cursr. In lwercase character mde, the CM 0 key allws yu t type in the uppercase symbls. When yu press the EXECUTE key, the system prcesses the line f data that yu just entered n the input line. In additin, yu can press the EXECUTE key t resume interrupted prcessing. Pressing the EXECUTE key when the input line is blank causes the same actin as a GO cmmand (see GO Cmmand in Chapter 2). - When yu press the HOLD key, all prcessing stps. Prcessing resumes when yu press the HOLD key a secnd time. Thus, the HOLD key allws yu t read displayed data during an utput peratin. While prcessing is stpped, the CMD key and the arithmetic peratr keys n the right f the keybard are restricted t use by service persnnel. The HOLD key als allws yu t change frm standard BASIC character mde t lwercase character mde and vice versa. See Natinal Character Sets in Chapter 3. (Shift)-While yu hld dwn a shift key, yu can select an uppercase symbl (in standard BASIC character mde) r an uppercase alphameric (in lwercase character mde) fr input. Operatin 7

12 (Cpy Display-when the CMD key is held dwn)-when yu hld dwn the CM D key and press the key belw Cpy Display, all data displayed n the screen is printed by the attached printer. Yu can use the cpy display functin when the system is in a hld state, r anytime the system is waiting fr input frm the keybard. On a cmbined BASIC/ APL machine, the CD key is used t activate the cpy display functin. The L32 64 R32 switch has n affect n printed data. The fllwing keys have a repeat capability, which means that they will cntinue t functin fr as lng as they are pressed: \"'" (Backspace)-When yu press this key, the cursr mves ne psitin t the left. When backspaced frm psitin 1 f the input area, the cursr mves t the rightmst psitin f the input area. When yu hld dm"m the CMD key and press this key, yu immediately delete the character at the current cursr psitin. All characters t the right f the cursr are shifted ne p'sitin t the left each time yu press this key. The cursr des nt mve. (Frward Space)-When yu press this key, the cursr mves ne psitin t the right. When spaced beynd the end f the input area, the cursr returns t the first psitin f the input area. When yu hld dwn the CMD key and press this key, yu immediately insert a blank character at the current cursr psitin, and all data fllwing the cursr psitin is shifted ne psitin t the right. The cursr des nt mve; thus yu can enter anther character int this psitin. If the input area cntains a character in the last psitin, the insert functin is ignred. (Scrll Up)-When yu press this key, each displayed line mves up ne line psitin (except the status line). This key als allws yu t change frm lwercase character mde t standard BASIC character mde (when used with the' HOLD and shift keys). When the keybard is pen and the cursr is displayed n ne f the tp 14 lines, the scrll up key mves the cursr up ne line. (Scrll Dwn)-When yu press this key, each displayed line mves dwn ne line psitin (except the status line). This key als allws yu t change frm standard BASIC character mde t lwercase character mde (when used with HOLD and shift). When the keybard is pen and the cursr is displayed n ne f the tp 14 lines, the scrll dwn key mves the cursr dwn ne line. /' ' (~' Nte: The spacebar als has repeat capability. Blanks are inserted if yu hld dwn the spacebar. 8

13 C) SWITCHES The fllwing swtiches are lcated abve the keybard n the cnsle: POWER ON/OFF - The pwer switch turns the system n and ff. When pwer is turned n, the system ~ecmes perable in apprximately secnds. RESTART - This is a spring-returned switch that reinitializes the system t its pwer n state. In the dual language system, the setting f the BASIC/ APL switch determines which language is initialized. BASIC / APL - This switch appears nly n the dual language system and determines which language is initialized at pwer n and restart. REVERSE DISPLAY - This tw-psitin switch sets the display screen t white characters n a black backgrund r t black characters n a white backgrund. Yu may want t adjust the BRIGHTNESS switch after setting the REVERSE DISPLAY switch. BRIGHTNESS - This cntrl varies the intensity f the characters r the screen backgrund. C) DISPLAY REGISTERS/NORMAL - This switch is fr use by service persnnel. This switch shuld remain in the NORMAL psitin during system peratin. L32 64 R32 - The three psitins f this switch are: L32 The leftmst 32 characters n the display screen are displayed with a blank between characters. 64 Up t 64 characters per line are displayed in adjacent psitins. R32 The rightmst 32 characters n the display screen are displayed with a blank between characters. INDICATORS The cnsle has tw indicatrs: PROCESS CH ECK - When this indicatr lights, a system malfunctin has been detected, and further peratins are nt nrmally pssible. Press the RESTART key. If the cnditin recurs, call fr service. IN PROCESS - This indicatr lights nly t infrm yu that the system is perating even thugh the display screen is turned ff. Because sme prgrams require several minutes f prcessing that turns ff the display, the IN PROCESS indicatr is yur assurance that the system is perating. When this indicatr light is n, the HOLD key des nt stp prcessing. Operatin 9._ _.. -_.. _-...._ _.

14 EDITING INPUT LINES If yu detect an errr in a line befre yu press the EXECUTE key t enter the line int the system, yu can use the frward space r backspace key t psitin the cursr at the errr, then: Yu can use the insert r delete functins t crrect the errr. Yu can press the ATTN key t blank all data t the right f the cursr. Yu can enter the crrect character. Nte that the APL symbls (upper shift n several keys) in Figure 3 can be entered int an input line. On a BASIC-nly keybard (Figure 4), hwever, these symbls d nt appear even thugh they can be entered int an input line. Because many f these symbls can be verstruck by ther characters (such as ' and. t create!) yu can take the fllwing steps t replace an APL symbl: 1. Psitin the cursr at the symbl. 2. Press the spacebar t erase the symbl. 3. Backspace the cursr t the blank psitin. 4. Enter the crrect character. If yu detect an errr in a line after yu press the EXECUTE key t enter the line, yu can use the scrll up r scrll dwn key t psitin the line t be crrected, then use the prcedures abve t crrect the errr. If yu want t change an entire line, yu can simply enter the statement number f the line, then reenter the line and press the EXECUTE key. The new line will replace the ld line. If yu want t delete ne r mre prgram lines, enter the statment number f the line yu want t delete, then enter DEL and press the EXECUTE key. T delete several succe~ssive lines, enter the number f the first line, enter DEL, enter the number f the last line, then press the EXECUTE key. Fr example, t delete lines 20 thrugh 90 in a prgram, enter: 20 DEL 90 then press the EXECUTE key. Nte the DEL is invalid while yu are entering a key grup (see Functin Keys). 10

15 C).. c.. / STORAGE CAPACITY The base system (Mdel 811 r 821) has a strage capacity f 16K (K=1,024 bytes). Figure 5 shws hw this strage is allcated t varius requirements. Nte that the wrk area available t the user is apprximately 1'1,500 bytes, while 4,500 bytes are required fr internal purpses. The strage capacity is increased in the fllwing mdels f the system (the first digit represents mdel number 1 r 2, and the secnd digit represents strage size): Mdel 812 and K Mdel 813 and K Mdel 814 and K In these mdels, all additinal strage is allcated t the user wrk area. Fr example, n the Mdel 814, the user wrk area is apprximately 59,500 bytes,. with the remaining 4,500 bytes used fr internal purpses. 11,500 8ytes User Wrk Area (data and prgrams) I ,5008ytes (internal system requirements) Figure 5. Strage Allcatin fr a 16K System Operatin 11

16 \.... (~ (~ \... ".' 12

17 "...."..."._-._..._... C) c Chapter 2. System Cmmands Sme f the system cmmands are listed abve the tp rw f numeric keys n the typewriter-like alphameric keybard (Figure 4). These cmmands allw yu t cntrl diskette, tape, and printer peratins, such as string a prgram, lading a prgram int the system, and executing a laded prgram. System cmmands can either be entered character-by-character frm the keybard, r the entire keywrd can be entered by hlding dwn the CM D key and pressing the apprpriate number key belw the cmmand (except fr thse, such as LINK and MERGE, that are nt listed). The latter peratin inserts the keywrd with a single keystrke, thus preventing pssible keying errrs and prviding faster peratin. The cmmands are used t direct the system t perfrm the fllwing types f peratins: Prgram Executin-Start r resume executin f a BASIC prgram r cmmand. File Operatin-Lad r save prgrams r data n tape, r diskette, r mark tapes/ diskettes. Prgram Operatin-List and number prgram statements r merge several prgrams int ne prgram. Parameters required fr a cmmand can be entered after the cmmand keywrd is entered. The cmmand peratin then starts after yu press the EXECUTE key. The cmmand keywrds and majr functins f the BASIC system cmmands are: ALERT AUTO CSKIP GO LINK LIST LOAD MARK MERGE PROC RD= RENUM REWIND RUN SAVE SKIP UTIL Alert the peratr frm a prcedure file Autmatic line numbering Skip within a prcedure file n a specified cnditin Resume interrupted prcessing Lad custmer supprt functins, features, r IMFs Display r print a BASIC prgram Lad a BASIC prgram Mark tape/ diskette files Merge a BASIC prgram Initiate input frm a prcedure file Specify runding psitin f printed numeric values Renumber statements Rewind tape Run a BASIC prgram Save a BASIC prgram Uncnditinally skip recrds within a prcedure file Perfrm system supprt functins C) System Cmmands 13

18 DEVICE ADDRESS PARAMETER Many BASIC cmmands and statements require entry f a device address parameter. This address identifies the input/utput device cntaining the file being prcessed. Valid device addresses fr the 5110 are: E80 - fr the built-in tape unit (Mdel 1 nly) E40 - fr the auxiliary tape unit (Mdel 1 nly) fr diskette drive fr diskette drive fr diskette drive fr diskette drive fr the printer fr directing utput t line 1 f the display screen (utput nly) fr allwing GET statements t access data entered frm the keybard (in the same manner that INPUT statements receive data) fr allwing up t 14 lines f the display screen t be used as keybard input, utput, r update as a recrd file / Nte: The nrmal system default address n the 5110 Mdel 1 is device E80. The nrmal system default address n the 5110 Mdel 2 is device 080. These defaults can be changed with the UTI L SYS cmmand, which allws yu t select the default address yu want t use (see UTI L Cmmand). If yu d nt enter a device address with cmmands, the default address will be used. Yu can als enter 'SYS' fr the device address parameter in the OPEN [FILE] and CHAI N statements t specify the system default device address. FILE REFERENCE PARAMETER The file reference parameter in many BASIC cmmands and statements can cnsist f either the file number r the file name, r bth the file number and name. File names can be f the fllwing types: Fr any files n tape, the file name can be any cmbinatin f up t 17 characters. Fr files n diskette, the file name can be either simple r cmplex. Simple file names can be frm 1 t 8 characters in length. The first character must be an uppercase alphabetic character (A-Z). The remaining characters can be alphanumeric (A-Z r 0-9). Blanks are nt permitted. A simple file name must be used when creating basic exchange diskette files (see Custmer Supprt Functins Reference Manual fr infrmatin n basic exchange files). "r--" ( I I " Cmplex file names can be tw r mre simple names separated by a perid. Ttal length f a cmplex file name is 17 characters including the perid separatr(s). As with simple file names, blanks are nt permitted within cmplex file names. 14

19 C) c; L """"""l,j When yu enter a file name, be sure t enclse it in single qutatin marks. If yu enter bth the nnzer file number and file name fr a diskette file, the system accesses the file by name, but als cmpares the number yu specify with the number f the file accessed. If the file number and name d nt match, an errr message is displayed. Nte: When a file is being accessed fr utput, an errr will ccur unless the file is unused (type 0)' r unless the file name yu specified matches the existing file name. See UTiL fr infrmatin n making a file unused r changing a file name. The syntax and descriptin f each cmmand is detailed in this sectin. Nte that the syntax used in BASIC cmmands is als used fr the BASIC statements (Chapter 4). In this syntax, parameters that must be specified as shwn are in uppercase letters. Parameters yu must supply are in lwercase letters. Optinal parameters are enclsed in brackets ([ ]). Parameters enclsed in braces ({}) indicate that yu must enter nly ne f the enclsed parameters. Ellipses (... ) indicate that the preceding parameters can be repeated. Single qutatin marks and parentheses must be entered where shwn. Cmmas must be entered t separate parameters, except between the keywrd and the first parameter. Each cmmand r statement entered frm the keybard is checked fr syntax errrs. If a syntax errr is detected, an up arrw (t) is displayed belw the psitin in the line where the errr was detected, the ptinal audible alarm sunds, the display screen flashes, and the keybard is lcked. The ATTN key and HOLD key are the nly active keys when the display screen flashes. Press ATTN t stp the flashing screen, then crrect the indicated errr. Sme general rules that apply t system cmmands are: N preceding statement number is needed. Each cmmand must begin a new line. Maximum cmmand length is 64 characters. Blanks are ignred except in character strings enclsed in single qutatin marks. Parameters must be separated by a cmma. System Cmmands 15

20 ALERT E:mmentJ ALERT COMMAND The ALERT cmmand allws yu t prvide an indicatin t the peratr that interventin is needed during the executin f a prcedure file (see Prcedure File). When executed, the ALERT cmmand halts system peratin, sunds an audible alarm, and causes the display screen t flash the wrd ALERT and the ptinal cmment. The peratr must press the ATTN key tstp the flashing screen. The ptinal cmment can be an instructin t change tapes r diskettes r perfrm ther necessary peratins. Cmment length is limited nly by line length. T resume nrmal peratin, the peratr can enter GO. T terminate peratin, the peratr can enter GO END. The ALERT cmmand can nly be entered in a prcedure file. Examl?ie The fllwing is a typical ALERT cmmand. ALERT REPLACE RECEIVABLES DISKETTE WITH PAYABLES DISKETTE When this cmmand is executed in a prcedure file, the assciated message will be flashed n the screen t instruct the peratr t change diskettes. ( -_.""", '- 16

21 AUTO COMMAND AUTO ~ine.num Lineremeni] ] C) C) The AUTO cmmand allws yu t initiate autmatic line numbering fr BASIC statements. Autmatic numbering simplifies the task f entering statements in a BASIC prgram. Yu can specify bth the beginning statement number and the increment between numbers. After yu enter a statement and press the EXECUTE key, the next stateme"nt number is generated and displayed. The syntax f the AUTO cmmand is as shwn abve, where: line-num is a psitive integer specifying the first statement number t be generated. The range f this number is 1 t If a beginning number is nt specified, a beginning number f 0010 and an increment f 10 are generated. increment is a psitive integer used t increment succeeding statement numbers. If a beginning line number is nt specified, the increment cannt be specified. The default is 10 fr this ptinal entry. Each statement number generated by the AUTO cmmand is fllwed by a blank, then the cursr, as shwn: 0010 System Cmmands 17

22 Nte Abut AUTO Autmatic numbering cntinues until any ther valid data, a cmmand wrd, fr example, r a statement number ther than the displayed number is entered in the input line. In this case, anther AUTO cmmand must be' entered in rder t resume autmatic numbering. Other ways t terminate AUTO numbering. are: press the scrll up key, which will display a new unnumbered line, r simply press the EXECUTE key when the input line cntains nly the line number. \ -. Example The fllwing examples shw AUTO cmmands: AUTO (then press the EXECUTE key) In this example, the display screen will shw statement number After yu press the EXECUTE key at the end f an entered statement, the statement number autmatically increases by 10, prducing statement numbers 0020, 0030, 0040, and s n. In the fllwing example, the beginning statement is After each succeeding statement is entered, the statement number is autmatically increased by 20, prducing statement numbers 0340, 0360, 0380, and s n. AUTO 320,20 (then press the EXECUTE key) 18

23 CSKIP integer [cmment] CSKIP COMMAND C) The CSKIP cmmand allws yu t cnditinally skip recrds within a prcedure file (see Prcedure File). This cmmand is valid nly when used with an active prcedure file. The syntax f the CSKIP cmmand is as shwn abve, where: integer indicates the number f prcedure file recrds t be skipped when the cnditin is satisfied. cmment is an ptinal cmment. Upn executin f the CSKIP cmmand, the value f the return cde'(the RC= parameter) set by the last END r STOP statement is checked. If the value is zer r less, n actin is taken. If the value is greater than zer, the specified number f recrds in the prcedure file are skipped. If the number f recrds specified exceeds the number f recrds remaining in the file, the prcedure file is clsed. The specified number must be a whle number. Fr example, an entry f 3.5 causes three recrds t be skipped, with the.5 assumed t be the beginning f the ptinal cmment. Example The fllwing example shws the executin f a SKI P cmmand within a prcedure file. C) LOAD 4 RUN CSKIP 3 LOAD 9 RUNS SKIP 3 ALERT INSERT TRANSACTION DISKETTE LOAD 11 RUN Upn executin f this prcedure file, the prgram in file 4 runs. If the prgram in file 4 sets the return cde t nnzer (see STOP statement), the CSKIP 3 causes the next three recrds in the prcedure file t be bypassed and ALERT t be prcessed. The prgram in file 11 is then run. If the return cde was. zer, the prgram in file 9 is laded and run instead. The SKI P then causes the remainder f the prcedure t be bypassed. System Cmmands 19

24 GO [ {Iine-num}] ['{~ENp END TRACE GPRIN"f] }] GRD=~ /" GO COMMAND Yu can use the GO cmmand t d the fllwing: 1. Resume r end prcessing f a BASIC prgram that was halted by ne f the fllwing: a. A PAUSE statement b. Executing statements in step mde (see RUN Cmmand) c. Sme errr cnditins d. Yur pressing the ATTN key 2. End a IV1ARK cmmand peratin befre it reaches its nrmal terminatin pint r resume an interrupted MARK peratin t re-mark a file. \, ~""""~'."" ' 3. Resume r terminate PROC file peratins interrupted by an ALERT cmmand. Yu can resume prcessing by pressing the EXECUTE key n a blank line (implied GO). The GO cmmand, hwever, allws yu t resume prcessing in any f three mdes f peratin (nrmal, step, r trace). Thus, yu can change the perating mde with the GO cmmand. Prgram executin can be cntinued with the next sequential statement r at a statement number specified in the GO cmmand. Yu can change the decimal psitin that activates ru,nding (see RD = Cmmand). T terminate the executin f a system cmmand r a BASIC prgram, the GO cmmand has this syntax: GO END END clses input and utput files, thus maintaining the integrity f the files. After the files are clsed, n prgram statements are executed. T cntinue executin f an interrupted peratin, the GO cmmand has this syntax: GO Oine-num] RUN }], STEP [,RD=n] [ { TRACE [,PRINT] where: line-num is the number f the statement at which prcessing is t be resumed. If this number is mitted, prcessing begins with the next sequential statement. 20

25 (~) RUN specifies that prcessing is t cntinue in nrmal mde. STEP specifies that prcessing is t cntinue in step mde (see RUN Cmmand). TRACE specifies that prcessing is t cntinue in trace mde (see RUN Cmmand). Nte: If neither RUN, STEP, nr TRACE is specified, prcessing will cntinue in the mde that was in peratin when prcessing was interrupted. /""-_. "', ~~! PRINT specifies that trace messages are t be displayed and printed. If PRINT is mitted, the messages are nly displayed. This entry shuld nly be specified with TRACE. RD = n indicates the number f digits t the right f the decimal pint that will initiate runding. n can be 1 t 15 and is initialized t 6. If nt specified, n retains its last value. Ntes Abut GO The statement number entry is valid nly during executin f a BASIC prgram. When the input line is blank, pressing the EXECUTE key causes the same peratin as a GO cmmand. In respnse t an errr indicating an attempt t mark a file already marked, GO must be entered nly in psitins 1 and 2 f the input line. Example The fllwing examples shw a variety f GO cmmands. 1. T change t r resume nrmal peratin f a BASIC prgram: GO RUN (then press the EXECUTE key). 2. T change frm step r nrmal mde t trace mde: GO TRACE (then press the EXECUTE key) C) 3. T change t step mde and begin executin at statement number 620: GO 620, STEP (then press the EXECUTE key) c System Cmmands 21

26 LI N K file-ref [,dev-address], LINK COMMAND The LI N K cmmand allws yu t access the custmer supprt functin features, and IMFs. T access these prgrams, enter the LINK cmmand with the syntax shwn abve, where: /' file-ref can be either the file name (enclsed in single qutatin marks), the file number, r bth the file number and name (see File Reference Parameter). dev-address is the address f the device cntaining the tape r diskette (see Device Address Parameter). Upn successful executin f the LINK cmmand, the system transfers cntrl t the supprt functin yu specified. If an errr ccurs during the LINK peratin, the system returns t lad a status. Reenter the LINK cmmand; if the errr cntinues t ccur, call yur service representative. Fr a cmplete descriptin f the custmer supprt functins see the IBM 5110 Custmer Supprt Functins Reference Manual, SA Example A sample LINK cmmand is shwn belw: LINK 2, 'ABC', 080 Upn executin f this cmmand, the system will link t the prgram in file 2 (called ABC) n the diskette in drive 1. ~,,I, 22

27 LlST[PRINT] [ {~EYX }], Ime-num LIST COMMAND The LIST cmmand allws yu t display r ptinally print the prgram r data lines frm the wrk area. The cntents f the wrk area are unchanged. The syntax f the LIST cmmand is as shwn abve, where: PRINT specifies that the list f lines in the wrk area is t be printed rather than displayed. If PRI NT is nt specified, the list will be displayed. KEYx specifies that the indicated key grup shuld be displayed r printed (x = 0 t 9). line-num specifies that a grup f 14 lines, ending with the indicated line number, is t be displayed. If PRINT is als specified, the entire wrk area, starting with the indicated line number, will be printed. If n line number is entered, the lwest line number in the wrk area is assumed t be the starting line number. This entry is nt valid fr a KEYx grup. U " When the listing is specified t the display, the line number specified in the LIST cmmand appears n line 2 f the display screen. Up t 13 preceding,lines (fewer, if less than 14 are defined) are displayed n the lines abve line 2. Yu can use the scrll up and scrll dwn keys (t and... ) t arrive at a particular line. When the listing is specified t the printer, the entire wrk area, starting with the specified line number in the LIST cmmand, is printed. Printing begins at the lwest line number if a line number is nt specified in the LIST cmmand. Ntes Abut LIST If the line number specified in the LIST cmmand is nt in the wrk area, the system will seek the next lwer line number fr the LIST peratin. If a lwer line number is nt fund, an errr message is displayed. r" U C) If the line length exceeds 64 characters, the succeeding line will cntain the excess ver 64 characters when the line is displayed. When printed, the full line will be printed up t 128 characters. The line length will nt affect the executin f the statement. If the system is listing data lines lnger than 118 characters n the display, the excess ver 118 characters is nt displayed. Yu can use the ATTN key t termina~e a LIST peratin t the printer. System Cmmands _.-...._--_ _... _

28 Example The fllwing examples shw several LIST cmmands: T display the first grup f wrk area lines: LIST (then press the EXECUTE key) T display line number 250 and the preceding 13 lines: LIST 250 (then press the EXECUTE key) T print line number 250 and all lines fllwing in the wrk area: LIST PRINT, 250 (then press the EXECUTE key),',/' -..., T display the first 14 lines in the grup assciated with functin key 5: LIST KEY5 (then press the EXECUTE key) 24

29 _.._...._..,,_._------_. LOAD file-ref KEYx KEYS DATA BASIC SOURCE [,dev-address] LOAD COMMAND The LOAD cmmand causes a previusly saved file t be laded int the wrk area (frm tape r diskette) fr mdificatin and/ r executin. LOAD can als be used t prepare the wrk area fr the entry frm the keybard f a new BASIC prgram, data, r key grup. The syntax f the LOAD cmmand is as shwn abve, where: file ref can be either the file name (enclsed in single qutatin marks), the file number, r bth file number and name. (See File Reference Parameter.) An entry f 0 indicates that a new file will be entered frm the keybard, regardless f device address specified. KEYx, KEYS, DATA, BASIC, r SOURCE specifies the type f data t be laded int the wrk area. BASIC is the default when yu are lading frm the keybard. BASIC r SOURCE is the default when yu are lading frm tape r diskette. dev-address is the address cde f the device cntaining a saved file t be laded. (see Device Address Parameter.) Entering a LOAD cmmand f LOADO clears the entire wrkarea, including all key grups. A LOADO cmmand specifying BASIC r DATA as the secnd parameter will nly clear the specified prgram frm the wrk area, withut altering existing key grups. If the new file type is a KEYx file, the new key file is added t the wrk area withut altering the existing wrk area. If the KEYx file already exists in strage, the laded KEYx file will replace the ld ne. Line 0 will display READY when the system is in standard BASIC character mde, DATA when in lwercase character mde, and KEYx fr key definitin mde. Yu can begin entering the specified type f lines int the wrk area. The line type entered (BASIC, DATA, r KEYx) must be the same type as the wrk area, r the line will nt be accepted and an errr message will appear n line O. KEYS and SOU RCE are nt valid ptins when yu are lading frm the keybard (KEYx is valid). System Cmmands 25

30 A LOAD nnzer entry specifies that a saved file is t be laded frm tape r diskette int the wrk area. Any previus cntents f the wrk area (except the keys files) are destryed when the file type is specified as BASIC, DATA, r SOURCE. If the new file type is a KEYx file, the new key file is added t the wrk area withut altering existing wrk area. If the KEYS/KEYx files already exist in strage, the laded KEYS/KEYx files will replace the ld nes. Fr example, if a new KEY6 functin is laded frm tape r diskette, it will replace the existing KEY6 functin. A cpy f the saved file is laded int the wrk area, and the fllwing infrmatin is displayed: User specified file identificatin (if any) Number f cntiguus 1,024-byte areas f strage in the file Number f cntiguus 1,024-byte areas f unused strage in the file First line number (fr BASIC) '--... Last line n'umber (fr BASIC) KEYx numbers (fr KEYx file types) Amunt f unassigned wrk area remaining (in bytes)-(nt fr KEYx file types) Ntes Abut LOAD File type KEYS (lad all keys functins within the specified file) is invalid when the file number is zer (LOADO). File type SOU RCE (lad a prgram in user surce frmat frm the specified saved file) is invalid when yu are lading frm the keybard (LOADO). When yu are lading a recrd file (type 9) r a stream file (type 1, 2, r 3), SOURCE is assumed unless DATA is specified. If file type is mitted, BASIC is assumed if yu are lading frm the keybard, and BASIC r SOURCE is assumed if yu are lading frm a saved file (depending n the type f file). In the latter instance, if the type f file is nt BASIC r SOURCE, an errr message is displayed. LOADO, DATA prvides autmatic line numbering and the cln fr each line. The display shws: 0010: If executin f a LOAD cmmand is interrupted (when yu press the A TIN key, r due t an I/O errr) while yu are lading a saved file, peratin is terminated.. If yu are lading a prgram, the prgram may be incmplete and may nt functin as intended. Calculatr statements are invalid if DATA is specified (LOADx, DATA). 26

31 -----_.---_.-... _ _ _ C) Ntes Abut LOAD SOURCE When a syntax errr ccurs during a LOAD SOURCE cmmand, yu must chse ne f the fllwing ptins: - Crrect the line and press the EXECUTE key t cntinue. - Scrll up t ignre the line and cntinue lading. If yu lad a SOURCE file cntaining a line lnger than 64 characters, yu will get an errr. The errr must be crrected r the line must be scrlled up (which ignres the line) befre lading can cntinue. The LOAD SOURCE cmmand is terminated by an errr (ther than a syntax errr) r by any use f a cmmand key whether r nt the key has a defined functin (see Functin Keys). Example The fllwing examples shw a variety f LOAD cmmands: T prepare fr keybard entry f a data file: LOA DO, DATA T prepare fr entry f a functin frm the keybard fr functin key 6: (~ LOA DO, KEY6 T lad a saved prgram (file 3) frm tape unit E40 (auxiliary tape unit): LOAD3, E40 T lad a prgram saved in user surce frmat frm file 6 n tape unit E80: LOAD6, SOURCE, E80 r LOAD6, E80 System Cmmands 27

32 Keybard Generated Data Files Yu can create a data file directly frm the keybard using the LOAD cmmand. First, enter LOADO, DATA, then press EXECUTE. The system respnds with autmatic line numbering (starting with 0010) fllwed by a cln. Yu can then enter numeric and character data. The end f a data file line is indicated when yu press the EXECUTE key. Data file lines are nt checked fr prper syntax. A typical data file line is: 0010: APRIL, , 'JONES', , 'BALANCE' ~-...,/, \... After all data file lines are entered int the wrk area, they can be saved. with the SAVE cmmand. Data file lines are saved withut line numbers r the cln. When data file lines are listed, the cln is displayed. Data in a keybard-generated data file can be accessed by input/utput statements during prgram executin r by a prcedure file t cntrl prgram executin. With line numbers and the cln remved, the data file is a cntinuus string f data items r recrds. Yu can edit a saved data file by first lading it back int the wrk area with a LOAD cmmand. When saved, the line numbers and cln are again remved. When laded, data lines are preceded by line numbers, starting with 0001 and incrementing by 1, and the cln. Functin Keys Ten functin keys are available fr yur use in invking prgrams r cmmands f yur chsing. The functin keys are the numeric keys 0-9 t the right f the typewriter-like keybard. The functins invked by these keys are defined in a LOAD cmmand. First, enter a LOAD cmmand specifying the key t which a functin is t be assigned. Fr example, t assign a functin t the 6 key, enter: LOADO, KEY6 (then press the EXECUTE key) 28

33 C) C~) Nw, yu must define a key grup, which is the statements assciated with the functin key. When yu press the CM D key and the 6 key, these are the statements that will be executed. One f five valid key grup header statements must be preceded by a line number f 999x, where x = 0 t 9 t represent the functin key. In the preceding example, the line number is The header statements are: NULL, which specifies that yu are nt defining a functin fr a particular key r that yu are deleting an existing definitin. CMD, which specifies that the remainder f the line is a system cmmand r a calculatr statement. This key grup can cntain nly ne system cmmand r calculatr statement. The specified peratin is perfrmed immediately (withut pressing the EXECUTE key). REM, which specifies that the key grup is a series f BASIC statements. These statements will be executed when the CMD key and the specified key is pressed r when the specific key grup is referenced in GOSUB. When referenced in GOSUB (GOSUB 999x), the prgram seeks the REM key grup and branches t it. If the REM key grup is nt fund, the prgram seeks statement 999x in the prgram and branches t it. The DATA, END, and STOP statements are nt permitted in a functin key. Thus READ, MAT READ shuld nt be entered. A RETURN r CHAIN statement will end definitin f a KEYx functin. The RETURN statement must nt cntain an expressin. TXT, which specifies that the character string (enclsed in single qutatin marks) is t be inserted in the input line beginning at the current cursr psitin. Fr example, assuming a character string' RATE' is assigned t functin key 5, each time functin key 5 is pressed while CMD is pressed, the cnstant RATE is inserted int the line being entered frm the keybard. KEYn, which indicates that the functin assigned t the n key is t be reassigned t the x key specified in line number 999x. The n functin key is set t NULL. In the fllwing examples, the functin keys will be assigned a number f functins. First, the LOADO, KEY6 cmmand prepares the wrk area fr assignment f the keys functin NULL indicates that the 6 key will have n defined functin. C \ /" 9996 CMD REWIND E80 indicates that the 6 key will cause the tape in the 5110 Mdel 1 built-in tape unit t be rewund each time the CMD key and the 6 key are pressed. System Cmmands _....._ _.._.....

34 Anther use fr the functin key is shwn belw: 9996 CMD A=&PI*Rt2 In this example, yu can cmpute the area f a circle by assigning a value t R (the radius) and pressing the numeric 6 key while the CM D key is pressed REM KEY6 FUNCTION 0001 FOR X = 100 t 360 STEP A = X/ I = 2*A 0004 PRI NT FLP, I,X 0005 NEXTX 0006 RETURN '. These BASIC statements will be executed each time the numeric 6 key is pressed while the CMD key is pressed, r if a GOSUB 9996 is executed TXT 'SPINDLES AND SPANGLES' indicates that the character string will be inserted int the current input line beginning at the current cursr psitin each time the 6 key is pressed while the CM D key is pressed KEY4 indicates that the functin assigned t the 4 key be reassigned t the 6 key. The 4 key is then set t NULL, meaning that it has n' defined functin. Nte that statements in an REM key grup can be deleted by reference t the key grup and use f the DEL editing functin. Fr example: KEY6, 10DEL deletes line 10 frm key grup 6. KEY6, 10DEL90 deletes lines 10 thrugh 90 frm key grup 6. Statements can be added r edited in the same manner: KEY6, 10 PRINT A adds line 10 r replaces the previus line 10 in R EM key grup 6. Nte that KEYx cannt be used t edit a key grup header statement. ',-. \ '-. 30

35 C) MARK COMMAND MAR K K-characters, files,starting file [,dev-address] 0 ", \, Yu can use the MARK cmmand t initialize ne r mre tape r diskette files t a specified number f cntiguus 1,024-byte areas f strage. If end f tape is reached befre the mark peratin is cmplete, the last file number and the number f 1,024-byte areas successfully marked in the file are displayed. If end f diskette is reached, the number f files successfully marked is displayed. The A TIN key is nt active during mark peratins. If yu try t re-mark a file n tape r re-mark a file that cntains data n diskette, an errr message is displayed (Appendix D). T cntinue, enter GO. Nte that yu must use the scrll up key r blank the input line befre entering GO nly in the first tw psitins f the line. If yu end the peratin by entering anything ther than GO in psitins 1 and 2, the file already marked is unchanged. Nte: If an existing file n tape is re-marked, the riginal infrmatin in the re-marked file and the existing infrmatin in the files fllwing the re-marked file cannt be used again. Files n diskette can be re-marked withut lsing infrmatin in files that fllw. The syntax f the MARK cmmand is as shwn abve, where: K-characters is the number f 1,024-byte areas f strage t be used n the tape r diskette. files is the number f cnsecutive files t be marked. starting file is the first (lwest numbered) file number t be marked. dev-address is the address f the tape r diskette drive in which the file resides. Default is the system default device address (see Device Address Parameter). System Cmmands 31

36 Ntes Abut MARK If an existing tape file is re-marked, the riginal infrmatin n the re-marked file cannt be used again. In additin, the infrmatin n files fllwing a re-marked tape file cannt be used again. This des nt apply t diskette files. The MARK cmmand can be issued any time the specified tape unit r diskette drive is nt therwise active. Tapes with ere errrs must be re-marked (reinitialized) starting with a file preceding the ere errr. A REWIND cmmand is generally required befre this MARK. ~, ~---_/ Yu can determine the size required fr a file by cmparing the amunt f wrk area available befre and after yu have entered data r prgrams int the wrk area. See Strage cnsideratins fr infrmatin n strage requirements fr data in the wrk area. Example A sample MARK cmmand is as shwn: MARK 3,6,1 In this sample, six files will be marked, starting with file 1, with each file using 3,072 (3K) bytes n the tape r diskette residing in the tape r diskette drive that is the system default device ~~

37 ..._---_..._... "....._ _-.._..._-----_ _-_.._._ MERGE file-ref [, [KEYx],[frm line-num], [thrugh line.num], [new line-num] [,dev-addres~j MERGE COMMAND The MERGE cmmand allws yu t merge all r part f a saved file ~ith data r a prgram (saved in BASIC frmat) in the wrk area. In this way, yu can add the same rutine t several different prgrams, r add the same data items t several different data files. Only BASIC statements (in a BASIC file) and stream DATA files can be merged. The wrk area and saved file must be f the same type. If these files are different, the MERGE cmmand is nt executed, and an errr message is displayed. Lines frm the file are added t the wrk area lines in line number sequence. If a line frm the file and a line in the wrk area have the same statement number, hwever, the line frm the file replaces the wrk area line. The merged file culd exceed the size f the wrk area, which causes an errr message t be displayed (see Appendix D). As the lines are merged, yu can specify that lines merged frm the file be renumbered, starting with a statement number f yur chice and increasing by the riginal file increment. After the merge is cmpleted, the display shws the READY message r DATA, alng with the number f unused bytes in the wrk area. The syntax f the MERGE cmmand is as shwn abve, where: file-ref can be the file name (enclsed in single qutatin marks), the file number, r bth file number and name (see File Reference. Parameter). KEYx is an active functin key grup int which the file is t be merged. frm line-num is the first line t be merged in the saved file. If n number is entered, the first line in the file is the default. thrugh line-num is the last line t be merged in the saved file. If n number is entered, the last line in the file is the default. new line-num is the first line number t be used in renumbering the lines frm the saved file. If n number is entered, the merged file will nt be renumbered. () dev-address is the address f the device in which the saved file resides. The default is the system default device address (see Device Address Parameter). C) System Cmmands 33

38 Ntes Abut MERGE This cmmand must be entered character-by-character frm the keybard. Omitted parameters must be indicated by cnsecutive cmmas. Fr example: MERGE 6,,2,200,,E80 / 'Omitted new line-num Omitted KEYx parameter,/ ",~... Example A sample MERGE cmmand is as shwn:,r--', (, \... MERGE. 6,,4,200, 10,E40 In this example, data frm file number 6 in the auxiliary tape unit will be merged with data in the wrk area. Lines frm the file will be merged. As the MERGE cmmand is executed, lines frm the saved file are renumbered, starting with line number Anther sample MERGE cmmand is: MERGE 5,KEY4,2,500,,080 In this example, lines 2 thrugh 500 frm file 5 will be merged with the. functin key grup currently assigned t the 4 key. File number 5 resides n diskette drive 1 (address 080).,~ ( \ With a file name, the cmmand abve culd be: MERGE 5, 'SYSIN',KEY4,2,500,,080 (~ \ '_._J'. 34

39 PROC file-ref [,dev.address] PROC COMMAND The PROC cmmand allws yu t initiate the use f a prcedure file (see Prcedure File). A prcedure file is a recrd I/O file n tape r diskette that cntains BASIC cmmands, statements, and/r input data. Data in a prcedure file can be used t replace data that is nrmally entered frm the keybard (in respnse t an INPUT statement, fr example), r t cntrl lading and executin f BASIC prgrams. The syntax f the PROC cmmand is as shwn abve, where: (J file-ref can be the file name (enclsed in single qutatin marks), the file number, r bth file number and name (see File Reference Parameter). dev-address is the address f the tape unit r diskette drive in which the prcedure file resides. The default address is the system default device address (see Device Address Parameter). Upn executin f a PROC cmmand, the file with the specified number r 10 (fr diskette) n the specified device is accessed fr prcedure file data. Yu can create a prcedure file just as yu create recrd I/O data files with a prgram r by using the LOADO, DATA cmmand. The PROC cmmand implicitly pens the prcedure file. Ntes Abut PROC The prcedure file will remain pen while the prcedure is active. A prcedure file is clsed by any errr, bya GO END cmmand (in respnse t an ALERT cmmand) r by a PROC cmmand embedded within the prcedure that calls anther prcedure. A prcedure file can supply data fr an INPUT statement nly if the RUN cmmand at the beginning f the prgram cntains the IN=P parameter (see RUN Cmmand). Example The fllwing is a sample PROC cmmand. PROC 3,'DAILY',D80 Upn executin f this cmmand, the prcedure file (named DAILY) in file 3 f the diskette in drive 1 will be initiated. System Cmmands 35

40 RD= COMMAND Yu can use the RD= cmmand t specify the number f digits t the right f a decimal pint that will be printed r displayed. If mre digits are t be printed r displayed, they will be runded t the number specified. At pwer n, runding is initially set t six digits. Runding can then be mdified with the RD= cmmand r in the RUN r GO cmmands. The range f runding (n) is 1 t 15 digits. Data printed with a PRINT USING statement is nt affected by the RD= cmmand. I \ '--,,- 36

41 RENUM [KEYX] [,first line-num Gincrement]] RENUM COMMAND Yu can use the RENUM (renumber) cmmand t generate new statement numbers fr all the BASIC statements r data in the wrk area. Like the AUTO cmmand, renumbering begins with 0010 and the increment is 10, unless specified therwise. In additin, all references t statement numbers such as in GOTO, IF, PRINT USING, GOSUB, and GET are changed t the new numbers. In functin key grups (see LOAD Cmmand), each key grup is renumbered as if it is a separate wrk area, and is nly renumbered if it is a BASIC prgram functin. (RENUM des nt alter the key grup header recrd.) The syntax f the RENUM cmmand is as shwn abve, where: KEYx specifies a key grup (x = 0 t 9) t be renumbered. first line-num is an integer (1-9989) identifying the number at which renumbering will begin. If this number is nt specified, a beginning number f 0010 and an increment f 10 are the default values. increment is an integer specifying the increment fr succeeding statement numbers. Default is 10. Ntes Abut RENUM Statement numbers are nt altered by a RENUM cmmand. An errr will ccur if yu try t renumber where a line number greater than 9989 will be generated. Example The fllwing examples shws the executin f a RENUM cmmand: RENUM 20,10 (then press the EXECUTE key) Befre 0010 INPUT A, B 0011 Q = INT (A/B) 0020 IFQ>O THEN GOTO PRINT Q 0035 GOTO STOP After 0020 INPUT A, B 0030 Q = INT (A/B) 0040 IFQ>O GOTO GOTO PRINT Q 0070 GOTO STOP System Cmmands 37

42 R EWI N D [dev-addressj REWIND COMMAND The REWIND cmmand allws yu t rewind the specified tape unit. The syntax f the REWIND cmmand is as shwn abve, where: dev-address is the address f the tape unit t be rewund (E8D fr the built-in tape unit r E4D fr the auxiliary tape unit). The default is the system default device address (see Device Address Parameter). Example A sample REWIND cmmand is as shwn: REWIND E4D C) c 38

43 RUN COMMAND The RUN cmmand starts executin f a BASIC prgram at the lwest numbered executable statement. The prgram must already reside in the wrk area, and the wrk area must be defined as cntaining a BASIC prgram (see LOAD cmmand fr lading prgrams and defining the wrk area type). Prgrams can be executed using lng (15 digits) r shrt (7 digits) precisin (see Precisin, in Chapter 3). BASIC prgrams can be run (executed) in three mdes: Nrmal Mde - All prgram steps are executed withut interruptin. Step Mde - The system stps immediately befre executing each prgram step (statement). The wrd STEP and the statement number f the next statement t be executed are displayed. T execute the next prgram statement, r t change executin mde, yu must execute a GO cmmand (see GO Cmmand). Step mde allws yu t display r alter variable values between steps fr debug purpses. (J Trace Mde - The statement number f each statement executed is displayed and/r printed while the statement is executed. Bth step and trace mdes are useful in lcating prgramming errrs. Trace prvides a mre rapid view f the prgram steps as they are executed. Step, n the ther hand, allws yu t examine the cntents f variables between prgram steps and t mdify prgram steps r data. The syntax f the RUN cmmand is as shwn abve, where: RUN specifies 15-digit (lng) precisin, requiring 8 characters in strage fr each numeric value. RUNS specifies 7 -digit (shrt) precisin, requiring 4 characters in strage fr each numeric value. STE~ specifies step-by-step executin. TRACE specifies cntinuus statement executin, but the line number f the statement just executed is displayed and / r printed. Nte that fr nrmal mde yu d nt specify STEP r TRACE. PRINT specifies that trace messages are printed and displayed (nly valid with TRACE). Als see File FLS in Chapter 3 fr a discussin f dynamic trace t the printer. System Cmmands 39

44 P = D specifies that utput frm prgrams specifying the printer is directed instead t the display screen. RD = n allws yu t specify the number f digits (n) t the right f the decimal pint that will cause runding n printed utput. The value n can be 1 t 15 and is initially set t 6 at pwer n. \'... --",/ IN = P is valid nly n a RUN cmmand within a prcedure file (see Prcedure File). This parameter allws yu t specify that data fr INPUT statements be supplied frm the prcedure file, rather than frm the keybard. Ntes Abut RUN The RUN cmmand will be rejected by the system if the wrk area file type is DATA. The RUN cmmand initializes all arithmetic variables and arrays t zers, and character variables and arrays t blanks. When P=D is specified, all PRINT FLP, PRINT USING FLP, MAT PRINT FLP, and MAT PRINT USING FLP statements are interpreted as PRINT, PRINT USING, MAT PRINT, and MAT PRINT USING statements, respectively, during this run. The IN=P ptin is valid nly when a prcedure file is active. Example Sme sample RUN cmmands are as shwn: 1. T begin nrmal executin f a prgram: RUN (then press the EXECUTE key) 2. T begin a trace peratin f a prgram and print the traced steps executed: RUN TRACE, PRINT (then press the EXECUTE key) 40

45 C) c:) SAVE file-ref SAVE COMMAND KEYS KEYx [SOURCE [,RECL=M [,NOBLOCK] J] SOURCE [,RECL=M [,NOBLOCK] J LOCK Gdev.addres~ c The SAVE cmmand allws yu t save the cntents f the wrk area in a specified file. After a SAVE cmmand is cmpleted, the display will shw the READY r DATA message and the fllwing infrmatin abut the file: The number f cntiguus 1,024-byte areas f strage allcated in the file. The number f cntiguus 1,024-byte areas f strage unused in the file. If the file cmes t end f file befre all f the wrk area is saved, an errr message is displayed (see Appendix D) and nly part f the wrk area is saved. T save the entire wrk area, enter anther SAVE cmmand specifying anther file with the crrect amunt f available space. CJ The syntax f the SAVE cmmand is as shwn abve, where: file-ref can be the file name (enclsed in single qutatin marks), the file number, r bth the file number and file name (see File Reference Parameter). File name is required fr saving diskette files. KEYS specifies that the cntents f all defined functin keys are t be saved. KEYx specifies that a functin key (x = 0-9) is t be saved (see Functin Keys). C ") j KEYx,SOURCE specifies that the functin key (x = 0-9) is t be saved as a BASIC prgram (withut the functin key header) in the same frmat in which the user entered it. SOURCE specifies that the cntents f the wrk area are t be saved in the same character frmat in which the user entered it. LOCK specifies that the BASIC prgram being saved is t be lcked. Yu cannt list, renumber, r edit a lcked prgram. Yu can, hwever, perfrm the fllwing with a lcked prgram: Lad fr executin Save n tape r diskette (BASIC frmat nly) Merge with lines in strage (the merged prgram is then cnsidered t be lcked) Run the prgram in nrmal mde (nt in step r trace mde) System Cmmands 41

46 RECL = m specifies that the file t be saved is a recrd I/O sequential file, and indicates the size (m) f the lgical recrds in the file. Lgical recrd size (m) must be a psitive, nnzer integer. NOBLOCK specifies that the file is t be saved n diskette in the unblcked frmat f ne lgical recrd per sectr. dev-address is the address f the tape unit r diskette drive in which the specified file resides. The default is the system dafault device address (see Device Address Parameter). I. Ntes Abut SAVE If KEYx, KEYS, r SOURCE is nt entered in the SAVE cmmand, data in the wrk area will be stred fr either a BASIC prgram r a DATA file, depending n the definitin f the wrk area. If yu interrupt executin f a SAVE cmmand by pressing the ATTN key, the peratin is terminated. If the interruptin ccurs befre the file has been changed, the file remains unchanged. The interrupt at any ther time will result in nly part f the prgram r data being saved. Only specified prgrams, data, and key functins are saved with the SAVE cmmand. Data values, buffers, and IMFs are nt saved. Yu must apply IMFs with the LINK cmmand befre yu lad the wrk area with any saved prgram requiring 1M Fs. A SAVE cmmand t a used file must cntain the same file name as the name f the used file. Example A sample SAVE cmmand is as shwn: SAVE 4,'KEY S',KEY S,ESD In this example, the cntents f functin key S are saved in file 4, which resides n the cartridge in the tape unit built int the 511 D Mdel 1. 42

47 SKIP integer [cmmen~ SKIP COMMAND The SKIP cmmand allws yu t uncnditinally skip a specified number f recrds within a prcedure file (see Prcedure File). The SKIP cmmand is valid nly when used within an active prcedure file. The syntax f the SKIP cmmand is as shwn abve, where: c) integer indicates the number f prcedure file recrds t be skipped. Upn executin f the SKIP cmmand, the specified number f recrds is uncnditinally skipped within the prcedure file. If the number f recrds t be skipped exceeds the number f recrds remaining in the file, the prcedure file is clsed. The specified number must be a whle number. Fr example, an entry f 3.5 causes three recrds t be skipped, with the.5 assumed t be the beginning f the ptinal cmment. cmment is an ptinal cmment. Example The fllwing 'example shws the executin f a SKIP cmmand within a prcedure file. LOAD 4 RUN CSKIP 3 LOAD 9 RUNS SKIP 3 ALERT INSERT TRANSACTION DISKETTE LOAD 11 RUN Upn executin f this prcedure file, the prgram in file 4 runs. If the prgram in file 4 sets the return cde t nnzer (see STOP statement), the CSKI P 3 causes the next three recrds in the prcedure file t be bypassed and ALERT t be prcessed.. The prgram in file 11 is then run. If the return cde was zer, the prgram in file 9 is laded and run instead. The SKIP then causes the remainder f the prcedure file t be bypassed. System Cmmands ,'...,.. _._------

48 [PRINT] GDI R [integer]] [,dev-address] 'ld file name' } FILEID file-num,'new file name' [,dev-address] { file-num, 'ld file name' '... ' va LI D [[new va 1-1 D], [ new wner-id], { ~~ F }, [ dev-address] ] '... ", UTIL {~~~:} {file-ref} [,dev-address] PROTECT [OFF,] file-ref [,dev-address] SORT.'..._... SYS new dev-address default UTIL COMMAND Yu can use the UTIL cmmand t d the fllwing: Display r print a directry f file infrmatin currently n tape r diskette. Rename a file n diskette. Change r display a diskette vlume ID and/r wner ID. Eliminate a file frm diskette and make that file space available fr allcatin fr ther files, r discntinue the cntents f a file n diskette r tape while leaving the file space allcated. Write prtect a file r remve write prtectin frm a file (diskette nly). Transfer system cntrl t the ptinal diskette srt feature. Change the system default device address. 44

49 Listing a File Directry Yu need apprximately 550 bytes f space in the wrk area t list a directry f file infrmatin. If sufficient wrk area is nt available during executin f a UTIL cmmand, an errr message (Appendix D) is displayed. Yu shuld save, then clear, the wrk area (with a LOADO cmmand, fr example) and cntinue with anther UTIL cmmand. Infrmatin abut each file is printed r displayed n ne line per file. If yu specify the PRINT parameter; all file infrmatin is printed. Yu can interrupt the listing t either the display r printer by pressing the ATTN key, which will terminate the cmmand, r by pressing the HOLD key nce, then pressing the HOLD key again t cntinue. The fllwing infrmatin is printed r displayed abut each file: The file number. The identificatin yu assigned t the file, if any (see SAVE Cmmand). File type (see File Types). The number f cntiguus 1,024-byte areas f strage allcated t the file. The number f cntiguus 1,024-byte areas f strage unused in the file. C) A number (0-9) indicating the number f defective physical recrd areas in the file, r an asterisk indicating that the number is greater than 9. This value can indicate when yu shuld relcate a file int anther file (tape nly) t avid lss f data due t defective areas n the tape. File prtectin indicatr (diskette nly). Data set starting lcatin (diskette nly). Key numbers saved in the file fr KEYS r KEY (0-9) files. The UTIL cmmand t print r display a directry f file infrmatin has the fllwing syntax: UTIL [PRINT] [;DIR [integer]] [,dev-address] where: PRINT specifies that the listing be printed. If the printer is nt specified, utput is displayed. DIR integer specifies that a directry be listed. The integer, which identifies the starting file number fr the listing, is ptinal. If the integer is nt entered, the listing will begin at the current physical lcatin f the tape r the beginning f the diskette. dev-address speciffes the address f the tape r diskette drive frm which the listing is t be made. The default is the system default device address (see Device Address Parameter). System Cmmands 45

50 Example The fllwing example shws a UTIL cmmand, which specifies that a directry be printed, starting with file number 1 n the 5110 Mdel 1 built-in tape unit. '". - " The resulting printed utput fr tape is shwn in the fllwing example: Iser Identificatin A~trage (in KJ 001 INTEF~N(.ll". O:~ ~3()U I~CE 00:'5 1< EY~:) I( EYX () ~ CI( ED OOb<EYY 1:1. 0:1, () (I ,009 0: :I,:~ 010, ,009 0 ~:~ / I I Defined Functin Keys c File Number File Type Defective Areas n Tape Unused Strage (in K) (*. d' th In Icates mre an nine defective areas) Fr a diskette file directry, a UTIL statement is: UTIL DIR1,D80 The resulting utput fr diskette is shwn in the fllwing example: /user Identificatin ~d Strage (in KJ rta Set Starting Lcatin' () 0:1. I N 'r E F< N til ~)OUF~CE 0003 ~:EYB OOOL! I{EYX O()()~j LDCKED () 0 06 I{ EYY \ File Number :1.: / :1. 0 J 0 0 () (? P 0201:1. :L / 000<i P 0310t:> :l.200:l (? p O~:;OOl : ,000<;' P ObOll File TYP! 2 0:1. () 0, /10 () 9 \ J~l/?(~ Defined Functin Keys '-./ Unused Strage (in K) File Prtectin Indicatr *Data set starting lcatin is five digits (cchrr), where cc=cylinder, h=head, and rr=recrd number (see IBM 5110 BASIC User's Guide). 46._-_._--- -_..._-_._...-._ _-_.-.._ _... _... _--_...-

51 File Types Valid file types listed with the UTIL cmmand are: Type File 0 Marked, unused tape file r diskette file 1 ** Data exchange file 2 General exchange file 3** BASIC surce file 4* BASIC wrk area file 5* BASIC KEYS file 6* APL cntinue file 7 APL save file 8 APL internal data 9 Recrd I/O file B9 Basic exchange, recrd I/O file 10 APL internal data (diskette nly) 11 BASIC wrk area file 12 BASIC KEYS file 15 APL mixed recrd file (diskette nly) 16* Patch, tape recvery, and tape cpy file 17* Diagnstic file 18* Cmmunicatin file 19* IMF file 21 Utility file 22 Feature file 23 IMF file 24 Diagnstic file 26 APL cntinue file (IBM 5110) *These file types can be created n an IBM 5100, but cannt be created r laded by an 5110 (see BASIC Cmpatibility with IBM 5100 BASIC). **These file types can be created n a IBM 5100 and can be read r laded by a 5110, but they cannt be created by a System Cmmands 47

52 Renaming a File n Diskette Yu can rename a file n diskette using the UTIL cmmand with the fllwing syntax: (~, I " 'ld file name' } UTI L F I LEI D file-num ;new file name' ['devaddress] { file-num,'ld file name' where: FILEID specifies that a diskette file name be changed. 'ld file name' indicates the current name assigned t the file. file-num indicates the number f the file t be renamed. Nte that either r bth the ld file name and file number may be specified. If bth are specified, they must be separated by a cmma with file number first. File name must always be enclsed in single qutatin marks (up t 17 characters). 'new file name' specifies the new name t be assigned t the file. dev address is the address f the diskette drive cntaining the file t be renamed. Default device address is the system default device address (see Device Address Parameter). A sample UTIL cmmand t rename a file is shwn belw. UTIL FILEID 7,'YTD.GROSS.SALES','YR76.GROSS.SALES',D80 File number 7 n diskette drive 1 will be renamed frm YTD.GROSS.SALES t YR76.GROSS.SALES in this example. 48

53 C) Changmg a Diskette Vlume 10 Yu can change a diskette vlume ID r wner ID with the UTIL cmmand having the fllwing syntax: UTI L va LI a rew vl-i a,new wner -10 {, ~~ F } [;dev-address ] ] where: VaLID specifies that a diskette vlume ID be changed r displayed. If this is the nly parameter entered fr the UTIL cmmand, the vlume ID, wner ID, 'and sectr size fields fr the diskette are displayed nly, and are unchanged. new vl-/d specifies the new vlume ID fr the diskette. This entry can be frm 1 t 6 alphameric characters. If yu d nt enter a new vl-id, the vlume ID remains unchanged. new wner-/d specifies the new wner ID fr the diskette. This entry can be up t 14 alphameric characters. If this parameter is nt entered, the current wner ID is unchanged. ON specifies that the vlume be prtected frm unauthrized access. This parameter des nt allw access t the diskette. OFF specifies that the prtectin indicatr fr the vlume be turned ff, making the vlume accessible. If this parameter is entered, bth the current vlume ID and wner ID must als be specified and must match thse n the diskette. dev-address specifies the address f the diskette drive n which the file resides. Default is the system device address (see Device Address Parameter). This address must nt be enclsed in single qutatin marks. C) When the UTIL VOLID cmmand is executed, the current vlume ID, wner ID, and sectr size fields are displayed, and the new vlume ID and wner ID entries are then assigned. Nte that mitted parameters. must be indicated by cnsecutive cmmas. A sample UTIL VOLID cmmand is shwn belw: UTIL VOLID DEBTS,ROWE,ON,D80 In this example, the diskette vlume 10 n the diskette in drive 1 (D80) will be changed t DEBTS, and the wner ID will be changed t ROWE. In additin, the vlume prtectin indicatr will be set n. With the indicatr n, the diskette cannt be used (including the UTIL VOLID cmmand) until the indicatr is set ff. Thus, befre setting prtectin n, be sure yu remember the vlume and wner 10, which yu must enter befre prtectin can be set ff. System Cmmands 49

54 Eliminating r Discntinuing a File Yu can use the UTIL cmmand t remve a file and make its physical file space available fr reallcatin, r simply reinitialize a file t unused status while leaving its file space allcated. The syntax f this UTIL cmmand is: UTI L DROP} {file-num } { FREE 'file name' [,dev-address] file-num;file name' where: DROP specifies that the file be reinitialized t unused status, althugh the file space allcated fr the file remains allcated. This parameter can be used t reinitialize bth tape and diskette files. FREE specifies that the file space allcated fr the file is t be freed and can be used fr allcatin t anther file. This parameter applies nly t diskette files. file-num specifies the number f the file t be deleted. This parameter is required fr tape files; it is ptinal fr diskette files. 'file name' specifies the name f the file t be deleted. This parameter can be up t 17 characters enclsed in single qutatin marks; Fr diskette files, this parameter must be specified if a file number is nt specified. file-num,'file name' indicate that bth the file number and file name can be specified, but must be separated by a cmma. (~, I, \...~. -" dev-address specifies the address f the tape unit r diskette drive n which the file t be deleted currently resides. Default is the system device address (see Device Address Parameter). A sample UTIL cmmand t delete a diskette file is: UTIL DROP 'YR76.TAXES',D80 In this example, the data in the YR76,.TAXES file will be deleted frm diskette drive 1. The file space will still be allcated, allwing anther file (YR77.TAXES, fr example) t be assigned t that space_ 50

55 Assigning r Remving File Write Prtectin fr Diskette Files Yu can use the UTIL cmmand t ensure the integrity f data in a diskette file by write-prtecting the file. This type f UTIL cmmand has the fllwing syntax: UTIL PROTECT [OFF] file-ref [,dev-address] where: PROTECT specifies that a file be selected fr assignment r remval f write prtectin. OFF specifies that write prtectin be remved frm a file that is currently write-prtected. If this parameter is mitted, ON is assumed. file-ref can be the file name (enclsed in single qutatin marks), the file number, r bth file number and name (see File Reference Parameter). dev-address specifies the address f.the diskette drive n which the file t be prtected currently resides. Default is the system device address (see Device Address Parameter). Nte: Write prtectin prevents rewriting f a file. The file can, hwever, be updated (see REWRITE FILE statement). A sample UTIL cmmand t assign write prtectin is shwn belw: UTIL PROTECT 'LOSSES', D80 In this example, the LOSSES file n diskette drive 1 will receive write prtectin, which ensures that ther data cannt be written int the file. System Cmmands 51

56 Selecting the Diskette Srt Feature Yu can gain access t the diskette srt feature using the UTIL cmmand with the fllwing syntax: UTIL SORT If the UTIL SORT cmmand is specified in a prcedure file, the next recrd is passed t the srt feature as if it were entered frm the keybard. After the srt is cmpleted, the prcedure file is still active, default device address remains the same, decimal runding is reset t six psitins, and all prgrams/ data are cleared frm the wrk area. Fr details cncerning the diskette srt feature, see the IBM 5110 Custmer Supprt Functins Reference Manual, SA Changing the System Default Device Address Nrmal system default device address fr the 5110 Mdel 1 is the built-in tape unit (address E80). Fr the 5110 Mdel 2, nrmal default device address is diskette drive 1 (address 080). Yu can change the default device address using the UTIL cmmand with the fllwing syntax: UTIL SYS new dev-address default where: SYS specifies that the system device address default be changed. new dev-address default specifies the new default device address. Valid addresses are: E80 - Primary tape unit (built int the 5110 Mdel 1) E40 - Auxiliary tape unit (mdel 1 nly) Diskette drive 1 D40 - Diskette drive Diskette drive Diskette drive 4 c 52

57 Chapter 3. Data Cnstants, Variables, And Cncepts BASIC CHARACTER SET The BASIC character set is used t represent arithmetic and character data entered frm the keybard as data cnstants and variables. The characters that have syntactical meaning in the BASIC language fall int three categries: alphabetic, numeric, and special characters. Alphabetic Characters The alphabetic characters in BASIC are the upper/lwercase letters f the English alphabet (A-Z) and the fllwing three characters called alphabet (the cmmercial at sign) # (the number r pund sign) $ (the currency symbl) C) Numeric Characters The numeric characters in BASIC are the digits 0 thrugh 9. Data Cnstants, Variables, And Cncepts 53

58 Special Characters There are 22 special characters in BASIC: Character + * / + ( ) &? > < Name Blank Equal sign r assignment symbl Plus sign Minus sign Asterisk r multiplicatin symbl Slash r divisin symbl Up arrw r e~pnentiatin symbl Left parenthesis Right parenthesis Cmma Perid r decimal pint Single qutatin mark Semicln Cln Ampersand Questin mark Greater than symbl Less than symbl Nt equal symbl Less than r equal symbl Greater than r equal symbl OR sign r vertical bar Use f Blanks Blanks may be used freely thrughut a prgram t imprve readability. They have n syntactical meaning except within character cnstants and in the image statement (see [MAT] PRINT USING and Image/FORM in Chapter 4), which specifies the frmat f printed r displayed data. c' 54

59 C) Underscre The underscre character (uppercase F) is a valid verstrike character in the system. Additinal underscre capability is prvided thrugh a special keybard peratin. When yu hld dwn the CMD key and press the spacebar, a symbl (.) will be displayed n the screen. This character can als be created if yu use the hexadecimal cnstant FF. Nte: D nt use the character in a data statement r in a cmment. The character can nly be displayed; it cannt be printed. When entered in a line f data t be printed, this character causes all characters t its right t be underscred until anther character is encuntered. When the data is printed, a blank will appear in place f the characters. Spaces between characters are nt underscred. An example f this functin is shwn belw. If yu enter THE MANUAL IS THE BASIC INTRODUCTION., SA '; this is printed: THE j"/j (~Ij"".! ( I ~:) THE f~ C! i.:.~.i!.. ~.~.1. t:~ J r:~!j I!!.) r.:~ :r.j. L! t1 ARITHMETIC DATA Arithmetic data is data with a numeric value. All numbers in BASIC are expressed t the base 10; that is, they are treated as decimal numbers. I ~-,J I Magnitude The magnitude f a number is its abslute value. The range f numbers permitted in BASIC prgrams is greater than r equal t 1 E-78 and less than 1 E+74. Precisin In BASIC, the precisin f a number is the maximum number f digits it can cntain. Yu can use the RUN cmmand t select lng r shrt precisin. When yu enter RUN (lng precisin)' each numeric data item will have 15-digit precisin, ccupying 8 character psitins f strage. When yu enter RUNS (shrt precisin)' each numeric data item will have 7-digit precisin, ccupying 4 character psitins f strage. All numbers in BASIC are cnverted t internal binary flating pint frmat fr prcessing. Because a decimal fractin may nt have an exact binary equivalent, sme truncatin errrs may ccur after the cnversin. Data Cnstants, Variables, And Cncepts 55

60 Arithmetic Data Frmats Arithmetic data can be entered, displayed, r printed in any f three frmats: integer, fixed pint, r flating pint. The apprpriate frmat fr a given number depends n its magnitude and the level f arithmetic precisin yu require. Numbers in any frmat can be psitive r negative. Negative numbers must be preceded by a minus sign. When n sign is specified, a number is treated as a psitive number, s plus signs are ptinal. Integer Frmat Numbers expressed in integer frmat (I-frmat) are written as a number f digits ptinally preceded by a sign. Examples f numbers in integer frmat are: Fixed-Pint Frmat Numbers expressed in fixed-pint frmat (F-frmat) are written as a number f ptinal digits preceded by an ptinal sign and fllwed by a decimal pint. The decimal pint can als be fllwed by a number f digits. These digits are required if a number des nt precede the decimal pint. Examples f numbers in fixed-pint frmat are: "'- 56

61 Flating-Pint Frmat Numbers expressed in flating-pint frmat (E-frmat) are written with an ptinal sign, fllwed by an integer r fixed-pint number, fllwed by the letter E. An ptinally signed ne- r tw-digit characteristic (expnent) must fllw the E. The value f a flating-pint number is equal t the number t the left f the E, multiplied by 10 t the pwer represented by the number t the right f the E. This ntatin crrespnds t standard scientific ntatin in which numbers are expressed as a pwer f 10. Nte, hwever, that while the number 10 7 is permissible in scientific ntatin, the number E7 is nt a valid flating-pint number. The value 10 7 must be expressed as 1 E7 in BASIC flating-pint frmat. Thus, BASIC flating-pint frmat requires a number t the left f the E. Examples f numbers in flating-pint frmat are: Flating Pint Number.25E E+5 5E E6 Equivalent Decimal Value Selecting An Arithmetic Frmat Yu can enter arithmetic values at the keybard in the mst cnvenient frmat fr yur applicatin. The number ne millin, fr example, can be entered in any f the fllwing ways: E+6 Data Cnstants, Variables, And Cncepts 57

62 ... ~.J ' The numeric size f arithmetic values is limited nly by the magnitude (~1 E-78 and <1 E+74). Nte, hwever, that the physical length f values yu enter is nt limited, althugh entries exceeding 15 digits will be truncated n the right t the lng system precisin f 15 digits, r 7 digits fr shrt precisin. Thus, very small and very large numbers can be entered in E-frmat. Fr example, yu can enter: (~~ 1.4E12 r the equivalent 1- r F-frmat value (14 fllwed by 11 zers). /---', (,,,.,/ Yu can use the BASIC statements t cntrl the frmat f arithmetic values displayed r printed (see PRINT USING and Image/FORM in Chapter 4). Thus, the frm f the values riginally entered des nt affect the utput frmat. Arithmetic Cnstants An arithmetic cnstant is either an integer, a fixed-pint, r a flating-pint number whse value is never altered during executin f the prgram. Thus, the integer 1 is a cnstant in the fllwing statement: X=X+1 Internal Cnstants An internal cnstant is an arithmetic cnstant with a predefined value. Unlike nrmal arithmetic cnstants, the internal cnstants are referred t by names, thugh like nrmal arithmetic cnstants, their values are never altered during prgram executin. The internal cnstants are: Cnstant Name Value pi 'TT &PI Natural lg &E Square rt f 2 &SQR Centimeters per inch &INCM Kilgrams per pund &LBKG Liters per galln &GALI The internal cnstant names can nly be used as parts f arithmetic expressin fr example: 2*&PI (then press the EXECUTE key) 58 The result is

63 C) Internal Variables The 5110 prvides three internal variables t aid in errr recvery: &LlNE Cntains the line number f the BASIC statement being executed when an errr ccurred &ERR Cntains the number f the errr fr which an ON ERROR statement has caused a branch f prgram cntrl &REC Cntains the relative recrd number f the last recrd referenced in a file T access the cntents f these internal variables, simply enter the variable as shwn abve and press the EXECUTE key r assign it t anther variable. Arithmetic Variables A variable is a named data item whse value is subject t change during executin f the prgram. Arithmetic variables are named by a single letter f the extended alphabet #, and $), r by a single, letter f the extended alphabet fllwed by a single digit (0-9). Examples f arithmetic variable names are A, A5, #1, and #7. When a prgram is executed, the initial value f arithmetic variables is set t zer. The nly exceptin is that variables assigned in a USE statement are nt initialized (see USE in Chapter 4) fr a prgram that is chained t (see CHAIN in Chapter 4). CHARACTER DATA Character data in BASIC is data withut a numeric value. Like arithmetic data, character data can be in the frm f cnstants r variables. Data Cnstants, Variables, And Cncepts 59

64 Character Cnstants A character cnstant is a string f characters enclsed in a pair f single qutatin marks. Any letter, digit, r special character can be included in a character cnstant. An apstrphe, hwever, must be indicated by tw single qutatin marks. Fr example, 'IT'S' represents ITS. The fllwing are all valid character cnstants: 'YES' 'THE SQUARE OF X IS' '12345' 'AB' The length f a character cnstant, when displayed r printed, is the number f characters it cntains, including blanks, but excluding the delimiting qutatin marks. Each pair f single qutatin marks used t represent an apstrphe is cunted as ne character. The maximum number f characters in a character cnstant is limited nly by the maximum number f characters n an input line, which is 64. Character Variables A character variable is a named item f character data whse value is subject t change during executin f the prgram. Character variables are named by a single letter f the extended alphabet #, and $), fllwed by the currency symbl ($). Examples f character variables are A$, #$, and $$. Character variables can be dimensined (see DIM Statement) t a length f 1 t 255 characters. When the prgram is executed, the initial value f character variables is set t blank characters. The nly exceptin is that variables assigned t the cmmn strage area are nt initialized (see USE in Chapter 4) fr a prdgram that is chained t (see CHAIN in Chapter 4). These variables are initialized t blanks by a LOAD r RUN cmmand (see Chapter 2). Character cnstants assigned t character variables are adjusted t the length f the character variable. Lnger cnstants are truncated; shrter cnstants are left-justified and padded with blanks n the right. /~ ( \, 60

65 ARRAYS An array is a cllectin f data items (elements) that is referred t by a single name. Only data items f the same type (numeric r character) can be gruped tgether t frm an array. Arrays can be either ne- r tw-dimensinal. A ne-dimensinal array can be thught f as a rw f successive data items. A tw-dimensinal array can be thught f as a matrix f rws and clumns. Figure 6 shws a schematic representatin f bth types f arrays. One-Dimensinal Array Named A A(l) A(2) A(3) A(4) Tw-Dimensinal Array Named B B(l,1) B(1,2) B(1,3) B(2,1) B(2,2) B(2,3) B(3,1 ) B(3,2) B(3,3) B(4,1) B(4,2) B(4,3) Figure 6. Schematic Representatin f One- and Tw-Dimensinal Arrays Each element in an array is referred t by the name f the array fllwed by a subscript in parentheses, which indicates the psitin f the element within the array. The general frm fr referring t an array element is: array name (rws, clumns) where array name is the name f the entire array, and rws, clumns are any psitive arithmetic expressins whse truncated integer values are greater than zer and less than r equal t the crrespnding dimensin f the array. Data Cnstants, Variables, And Cncepts 61

66 The expressin in a subscript referring t an element f a ne-dimensinal array gives the psitin f the element in the rw, cunting frm left t right. Thus, the third element f a ne-dimensinal array named A can be referred t by the symbl A(3}' as in this example: A(3) = 25 The first expressin in a subscript referring t an element f a tw-dimensinal array gives the number f the rw cntaining the referenced element. Rws are numbered frm tp t bttm. The secnd expressin in the subscript gives the number f the clumn. Clumns are numbered frm left t right. Thus, the secnd element in the furth rw f a tw-dimensinal array named 8 can be referred t by the symbl 8(4,2), as in this example: 8(4,2) = 1.53E6 The dimensins f an array and the number f elements in each dimensin are established when the array is declared. '... Declaring Arrays Arrays can be declared either explicitly by use f the USE r DIM statement r implicitly by a reference t an element f an array that has nt been explicitly declared. When an array is declared explicitly, the dimensins and the maximum number f data items that can be cntained in each dimensin are specified in the USE r DIM statement. When an array is declared implicitly, by a reference t ne f its elements when its name has nt appeared in a prir USE r DIM statement, it will have the number f dimensins specified in the reference, and each dimensin will cntain 10 elements. Fr example, when n prir USE r DIM statement exists fr an array named A, the statement: A(3) = 50 will establish a ne-dimensinal array cntaining 10 elements, the third f which will have the integer value 50. The remaining elements will be initialized t zer. Likewise, when n prir USE r 01 M statement exists fr an array named 8, the statement: 8(5,6) = will establish a tw-dimensinal array cntaining 10 rws and 10 clumns (100 elements), with the sixth element in the fifth rw equal t

67 C) (- -',,,---) Arrays with dimensins that cntain mre than 10 elements cannt be implicitly declared. Thus, withut the apprpriate prir USE r DIM statement, the fllwing statements wuld bth cause errr cnditins: A(15) = 22.4 B(3,20) = 66.6 After an array has been declared, either explicitly r implicitly, it cannt be explicitly dimensined by a 01 M statement anywhere in the prgram. Redimensining Arrays Numeric and character arrays can be redimensined accrding t the fllwing rules: Bth ne- and tw-dimensinal arrays can be redimensined. The ttal number f elements in an array after redimensining must nt exceed the number riginally specified when the array was declared. The number f dimensins can be changed. The maximum value fr a dimensin is An array can be redimensined in a MAT assignment statement r MAT input statement. The new dimensins fr the array can be specified with either a cnstant r by an expressin. Arithmetic Arrays An arithmetic array cntains nly numeric data and can have ne r tw dimensins. Arithmetic arrays are named by a single letter f the extended alphabet #, and $). Thus, the letter A can be used t name an arithmetic variable r an arithmetic array, r bth, while the symbl A2 can nly be used t name an arithmetic variable. Fr example: A=6 A(1) = 9 C) where the variable A = 6 (scalar) and A(1) = 9 (arithmetic array element). All elements f an arithmetic array are initially set t zer when the prgram is executed (except thse assigned t the cmmn strage area fr use in a prgram that is chained t; see USE and CHAIN in Chapter 4). Befre being used in any f the matrix-handling statements, an arithmetic array must have been previusly dimensined, either explicitly r implicitly. Arithmetic arrays can be redimensined as described previusly. Data Cnstants, Variables, And Cncepts 63 "------_._._---,,_._._-,,_._-_._------_.

68 Character Arrays A character array cntains nly character data and can have ne r tw dimensins. Character arrays, like simple character variables, are named by a single letter f the extended alphabet fllwed by the currency symbl ($). Thus, the name 0$ can refer t either a simple character variable r a character array. The name 0$(2,4) refers t the furth element f the secnd rw f a tw-dimensin character array. Fr example: 0$ = 'JONES' 0$(2,4) = 'SMITH' Character arrays can be used in input, utput, and simple matrix assignment statements (when n arithmetic peratin is perfrmed) and can be redimensined as described previusly. Summary f Naming Cnventins Figure 7 shws a summary f the naming cnventins previusly described fr variables and arrays. The symbl ext in Figure 7 dentes a letter f the BASIC extended alphabet #, and $). Infrmatin in brackets is ptinal. Data Type Name Examples Arithmetic variables ext [digit] A,$5 "r (. ' Arithmetic arrays ext A,$,# Character variables ext $ A$, Character arrays ext $ A$, Figure 7. Naming Cnventins fr Variables and Arrays ~- \ 64

69 SYSTEM FUNCTIONS The IBM 5110 BASIC language includes system functins that perfrm a number f cmmnly used peratins. In additin, yu can define and name yur wn functins by using the DEF statement (see DfF, RETURN, FNEND in Chapter 4). The system functins shwn in Figure 8 can be used anywhere in a BASIC expressin where cnstants, variables, r arithmetic array element references can be used, as shwn in these examples: A = SIN(&PI) + 1 B = SQR(X + 3) R1 = RND Mst f the system functins have a single argument (ptinal with RNp), which can be a valid expressin (explained later in this chapter) and prduce a single result. An invalid argument prduces an errr. The argument fr the DET functin must be a reference t a square arithmetic array. Minimum precisin fr these system functins is 10 digits. The system functins are listed in Figure 8. Ci Functin Name ABS(x) ACS(x) ASN(x) ATN(x) CEN(x) CHR(x) COS(x) COT(x) CSC(x) DEG(x) DET(x) EXP(x) HCS(x) HSN(x) HTN(x) I DX(X$,Y$) INT(x) KLN(X$) KPS(X$) Descriptin Abslute value f x Arc csine (in radians) f x Arc sine (in radians) f x Arc tangent (in radians) f x Degrees Centigrade (celsius) crrespnding t X degrees Fahrenheit Character string value f arithmetic expressin X Csine f x radians Ctangent f x radians Csecant f x radians Number f degrees in x radians Determinant f an arithmetic array1 Natural expnent f x Hyperblic csine f x Hyperblic sine f x Hyperblic tangent f x Psitin f Y$ character string within the X$ character string (relative t psitin 1) r zer if Y$ is nt in X$ Integral part f x Length in characters f the embedded key fr file X$ Beginning character psitin f the embedded key fr file X$ C) 1 Maximum matrix size is 50x50. Result f less than 1 E-20 is the same as zer. Data Cnstants, Variables, And Cncepts 65

70 Functin Name LEN(X$) LGT(x) LOG(x) LTW(x) MAX(X,V... ) MIN(X,V... ) NUM(X$) PRD(x) RAD(x) RLN(X$) RND[ (x)] SEC(x) SGN(x) SIN(x) SQR(x) STR(X$, y [,z] ) SUM(x) TAN(x) Descriptin Length f character string X$ (less trailing blanks) Lgarithm f x t the base 10 Lgarithm f x t the base e Lgarithm f x t the base 2 Maximum value f arithmetic scalars (X, V... ) r character arguments (X$,Y$... ) Minimum value f arithmetic scalars (X, V... ) r character arguments (X$,Y$... ) Cnverted numeric value f character string X$ Prduct f the elements f array x Number f radians in x degrees Length f the last recrd referenced fr file X$ Randm number between 0 and 12 Secant f x radians Sign f x (-1, 0, r +1) Sine f x radians Square rt f x Substring f character variable X$, starting with the yth character and extending t the end f X$ r fr z characters Sum f the elements f array X Tangent f x radians Figure 8. System Fuctins 2A nnzer argument t RN D starts a series f randm: numbers determined by the argument value. A zer argument t RND starts a new series f randm numbers with an undetermined value. If n argument is specified t RND, the next number in the current series is returned. 66

71 C~) EXPRESSIONS An expressin in BASIC is any representatin f an arithmetic r character value. Cnstants, variables, arrays, array element references, and functin references are all cnsidered expressins. Yu can als frm expressins by cmbining any f these value representatins with symbls called peratrs. An peratr specifies either the relatinship between data items, an arithmetic peratin t be perfrmed n them, r whether they are psitive r negative. Fr example, the symbls >, *, and + are peratrs specifying greater than, multiplicatin, and additin (r psitive value), respectively. ( \... / A special class f expressins, called relatinal expressins, is used with the IF statement t test the truth f specified relatinships between tw values. Expressins referring t entire arrays, rather than individual array elements, are called array expressins. An expressin that des nt cntain a reference t an entire array is called a scalar expressin. Arithmetic Expressins and Operatrs An arithmetic expressin can be an arithmetic variable, array element, cnstant, r functin reference; r it can be a series f the preceding items separated by peratrs and parentheses. Sme examples f arithmetic expressins are: A1 X3/ (-6) X+Y+Z SIN{R) (X - Y t 2/2+ X) Yu btain the value f an arithmetic expressin by perfrming the implied peratins n the specified data items. The five arithmetic peratrs are: Symbl Meaning ( -.. j t r ** Expnentiatin * Multiplicatin / Divisin + Additin Subtractin Nte that the system stres ** as t. Data Cnstants, Variables, And Cncepts _._.._..._._...

72 The psitive/negative peratrs are: + Psitive (used nly fr clarity) - Negative (changes the sign f the perand fllwing it) Special rules fr the arithmetic peratrs and the resulting actins are as fllws: Expnentiatin: The expressin At 8 is defined as the variable A raised t the 8 pwer. 1. If A=8=0, an errr will ccur. 2. If A=O and 8<0, an errr will ccur.,/, 3. If A<O and 8 is nt an integer, an errr f a negative number t a fractinal pwer will ccur. 4. If AtO and 8=0, At 8 is evaluated as If A=O and 8>0, At 8 is evaluated as O. Multiplicatin and Additin: A*8 and A+8, multiplicatin and additin respectively, are bth cmmutative; in ther wrds, A*8=8*A and A+8=8+A. Hwever, multiplicatin and additin are nt always assciative because f lw-rder runding errrs; fr example, A*(8*C) des nt necessarily give the same results as (A*8)*C. Divisin: A/8 is defined as A divided by 8. If 8=0, an errr (verflw) will ccur. Subtractin: A- 8 is defined as A minus 8. N special cnditins exist. Psitive/Negative Operatrs: The + and - signs can als be used as psitive/negative peratrs, which can be used in nly tw situatins: Fllwing a left parenthesis and preceding an arithmetic expressin As the leftmst character in an entire arithmetic expressin that is nt preceded by an peratr Fr example: -A+(-8) and 8-(-2) are valid. A+-8 r 8--2 are invalid. ~ I \ \...,- 68

73 C) Arithmetic Hierarchy Arithmetic expressins are evaluated accrding t the hierarchy f the peratrs invlved. Operatins enclsed in parentheses are perfrmed first. Operatins with a higher pririty level are perfrmed befre thse with a lwer pririty level. Operatins at the same pririty level are perfrmed frm left t right. The hierarchy f the peratrs are: Operatr Hierarchy 1. Enclsed in parentheses Highest 0 ". 2. t r ** 3. Psitive + and Negative - 4. * and / 5. Additin + and Subractin - Lwest Yu evaluate an expresin by reducing it t its cmpnent subexpressins. A subexpressin is defined as a grup that can be read perand-pera tr-perand, where an perand is ne f the fllwing: A simple reference t data (cnstant r variable) A subscripted array reference A functin reference A parenthesized subexpressin Starting with the first peratr t be executed accrding t the hierarchy, the perands f its subexpressin are reduced t simple references t data in a left-t-right rder. This prcess is repeated as many times as required in a left-t-right rder r in a decreasing rder f pririty, r bth, f the remaining peratrs until the entire expressin is reduced t a simple reference t the evaluated result. " 0, Data Cnstants, Variables, And Cncepts 69

74 ... The fllwing examples illustrate the successive steps in the evaluatin f fur arithmetic expressins accrding t the rules just described. In each expressin, the variables A, B, and C have been assigned the integer values 4, 6, and 2, respectively. Expressin -A t2+b/c*2.5 (-At2)+B/C*2.5 -A t (2+B/C) *2.5 -At((2+B)/C)*2.5 Evaluatin and Result -4t2+6/2* /2* /2* * (-4t2)+6/2* /2* * t(2+6/2) *2.5-4t(2+3) *2.5-4t5 * * * t((2+6)/2) *2.5-4t (8/2) *2.5-4t4 * * * / \.. ' _... Character Expressins A character expressin is a character cnstant, a character variable, a character valued functin reference, a single element f a character array, r a substring (STR) functin. The nly peratrs ever assciated with character expressins are the cncatenatins symbl and relatinal peratrs described next. The fllwing are examples f valid character expressins: D$(4)='DFR' A$='SER' STR(A$,1,3)=8$ A$=8$1 I C$ CHR(A-B) MIN('A','C','E') r MIN (A$,B$,C$) MAX('D','F,'R') r MAX(D$,F$,R$) 70

75 ,, _-_.. _----._--- Substring Functin A character string is a sequence f characters in a character expressin. The string (STR) functin allws yu t extract, cmbine, r replace specific characters in the expressin. The STR functin is used with LET statements t d the fllwing: Extract characters-fr example, in the fllwing statements: 10 A$ = 'PRODUCTION CONTROL' 20 STR( B$, 1, 1 0) = STR(A$,1, 1 0) statement 20 extracts the first 10 characters frm A$ and assigns them t the first 10 characters f B$. In statement 20, A$ is the expressin frm which characters are t be extracted, 1 is the psitin f the first character t be extracted, and 10 is the number f characters t be extracted. Cmbine characters-fr example, in these statements: 10 A$ = 'PRODUCTION' 20 B$ = 'CONTROL' 30 LET STR(A$, 12,7) = B$ statement 30 places the cntent f B$ (CONTROL) with the cntent f A$ (PRODUCTION) after the 11 th character, which is a blank. In statement 30, A$ is the expressin t which characters will be included, 12 is the first psitin t be filled by the additinal characters, and 7 is the number f characters t be included. The 7 is ptinal. If it is mitted, the remainder f the string (A$) is used starting at the specified psitin (12). Replace characters-fr example, in these statements: 10 LET A$ = 'PART 789' 20 LET B$ = 'PART 1234' 30 LET STR(A$,6,4) = STR(B$,6,4) statement 30 replaces the 789 in A$ with the 1234 frm B$. Again, the numbers 6 and 4 in statement 30 specify the first character t be replaced and the number f characters t be replaced, respectively. These numbers d nt have t be the same n bth sides f the equal sign. c Data Cnstants, Variables, And Cncepts 71

76 Cncatenatin Cncatenatin is jining tw character expressins using the cncatenatin symbl I I. The fllwing is an example f cncatenatin: 0 :L 0 :0 I )"'1 (:1 ~I;!.::i 0 ;.:.:: 0 :0 I!'ii 1-:.: ':1:,+ 0 ::::) 0 (:'1 ':1: :::: I i.. i I i! i\! E I 0 q. 0 :0 ':i; :;:: I ~::; (j 'r (:', I I] 0!.:;i 0 C ':i; :::: i::', ':j:. ~~ ~:~ E : ';!:' In this example, the character string A$ is cncatenated with the character string B$ t frm string C$ (MINNESOTA). When tw r mre character strings are cncatenated, the length f the resulting string is the sum f the individual strings. Relatinal Expressins A relatinal expressin cmpares the value f tw arithmetic expressins r tw character expressins. The expressins t be cmpared are evaluated and then cmpared accrding t the definitin f the relatinal peratr specified. Accrding t the result, the relatinal expressin is either satisfied (true) r nt satisfied (false). Relatinal expressins can appear in a BASIC prgram nly as part f an IF statement. The relatinal peratrs and their definitins are: Operatr Meaning Equal ;t r < > Nt equal ~ r > = Greater than r equal $ r < = Less than r equal > Greater than < Less than (--'".,... _---.,,' Nte: The system stres < > as ;t, <= as $, and >= as ~. Cmparisn uses all 15 digits. Thus, if yu cmpare the relatinship f tw numbers, they must cmpare in all 15 digits fr the relatinship t be true. The general frmat f a relatinal expressin is: e 1 relatinal-peratr e 2 where e 1 and e 2 are any expressins ther than array r relatinal expressins, and relatinal-peratr is any f the peratrs just described. Bth e 1 and e 2 must be f the same data type (character r arithmetic), and nly tw expressins can be cmpared in a single relatinal expressin. 72

77 ._------_.._._..._---_... C) When character data appears in a relatinal expressin, it is evaluated accrding t EBCDIC value (see Appendix A) character by character, frm left t right. Thus, the fllwing relatinal expressins wuld all be satisfied:, ABC'=' ABC', ABLE' <' BALL' '123'>'BALL' '$12'<'7' When character perands f different lengths are cmpared, the shrter perand is cnsidered t be extended n the right with blanks t the length f the lnger perand. Thus, in the preceding third example, values cmpared are 123lJ and BALL, where lj is a blank character. Relatinal expressins can als cntain the lgical AND/OR expressins. In BASIC, the ampersand (&) is used t specify that tw sets f arithmetic r character expressins be cmpared. Fr example: e 1 relatinal-peratr e 2 & e 3 relatinal-peratr e 4 where e 1 thrugh e 4 are expressins. In this example, the relatinal expressin is true nly if the relatin between e 1 and e 2 and the relatin between e 3 and e 4 is satisfied. The vertical bar ( I ) is used t specify that either f tw sets f expressins can cmpare in rder fr the relatinal expressin t be true. Fr example: e 1 relatinal~peratr e 2 I e 3 relatinal-peratr e 4 where e 1 thrugh e 4 are expressins. In this example, the relatinal expressin is true if either the relatin between e 1 and e 2, r between e 3 and e 4 is satisfied. Fr mre infrmatin n these lgical peratrs (& and I), see the I F statement. Array Expressins c.) In mathematics, a matrix is a grup f arithmetic values arranged in a system f rws and clumns, and a vectr is a series f arithmetic values arranged in a single rw. In the BASIC language, hwever, a matrix is a ne- r tw-dimensinal array. Array expressins are used t perfrm peratins n the entire cllectin f numeric r character array elements rather than n each element individually (scalar peratins). (see MAT assignment Statements in Chapter 4.) Data Cnstants, Variables, And Cncepts 73

78 DATA FILES AND ACCESS METHODS The IBM 5110 is capable f prcessing tw distinct types f data files: stream I/O and recrd I/O. Each f these files is described belw.,/-~.-" Stream I/O Data Files Stream I/O data files are useful fr cllecting streams f variable-length data items and string them in sequential rder as recrds in a tape r diskette file. Stream I/O files must be pened (see OPEN statement) befre they can be accessed, using the PUT statement t stre data items in the file and using the GET statement t retrieve data items frm the file. These files are rganized fr sequential access (ne recrd after anther in the rder the recrds were entered). These files must als be clsed after being used (see CLOSE statement). /~.-"-. The data items within each lgical recrd f a stream I/O file must be separated by a cmma. When numeric data items are read frm the file, the system retrieves them in successin and cnverts them int internal numeric frmat. When character data items are read frm the file, the system lcates the next nn blank character, ignring the cmma separatrs. If the retrieved character is a single qutatin mark, the data item fllwing must be a valid character cnstant. The end f the character cnstant is indicated by its clsing single qutatin mark. If the first character retrieved by the system is nt a single qutatin mark, the end f the character data item is indicated by the next cmma. Thus, t have a cmma in the character string, the entire character string must be enclsed in single qutatin marks. \ "-_.. ' Recrd I/O Files Recrd I/O files are useful fr cllecting related numeric and character data items and string them as a unit in a fixed-length lgical recrd. These files must be pened befre yu can access them using the WRITE FI LE statement t stre data items in the file and the READ FILE statement t retrieve data items frm the file. Recrd I/O files can be accessed sequentially, directly, r key indexed. Sequential Access A recrd I/O file can be accessed in the rder in which the recrds were placed in the file. This is called sequential access. Sequentially accessed files allw yu t: /' ' ( Read recrds using READFILE Read and update recrds using READFILE fllwed by REWRITEFILE Add recrds t the end f a data file using WRITEFILE 74

79 Direct Access c) In a directly accessed file, each recrd is assigned a specific recrd number based n the psitin f that recrd in relatin t the beginning f the file. This is called the relative recrd number (als called lgical recrd number). In directly accessed files recrds can be accessed in any rder if the REC=n parameter is specified n the READFILE r REWRITEFILE statement. This access methd is called direct access by relative recrd number. A directly accessed file can als be accessed sequentially if the REC=n parameter is nt specified. Directly accessed files allw yu t: Read recrds in any rder using READFILE REC=n Update recrds in any rder using REWRITEFILE... REC=n Add recrds t the end f a file using WRITEFILE Read recrds using READFI LE Read and update recrds using READFILE fllwed by REWRITEFILE Key Indexed Access An indexed file allws yu t select a particular field (up t 28 bytes f character data) within each recrd t be used t identify that recrd. The field yu select is called the key fr the recrd. Each recrd must have a unique key, with the key field in the same psitin fr every recrd. Fr example, assume a recrd length f 60 characters fr each recrd in a file. Als assume that psitins 1 thrugh 10 in every recrd are selected as the key field. IwlEIlislEI I II I II I I I I I I I I I I I I I I I I I I I I I IWIIINI Tl E I R I I I I I I I I I I I I I I I I I I I I I I I I I I I 10 ILlsl' NI I, I,,, I, I I, I, I I I, I I I I I I I I I I \. I 1 Key Field Each recrd can then be accessed accrding t its unique key in the key field. When yu access a recrd, yu specify the recrd key (KEY=parameter), which is called a search argument. Fr key indexed files, the system als maintains an index file cntaining the key and lcatin (relative recrd number) n tape r diskette f each recrd in the file. c.. \ I Data Cnstants, Variables, And Cncepts 75..._._.._ _.._ _._ _---.-

80 ~ When yu access a recrd by specifying its key, the system searches the index file fr the key that is greater than r equal t the search argument and ges directly t the crrespnding tape r diskette lcatin t retrieve the recrd. This is called direct access by key index. Because the index file cntains nly the recrd key and lcatin, it can be searched mre quickly than all recrds in the file; therefre, recrd retrieval time is substantially reduced. Retrieval time can be reduced even further if yu srt the keys in the index file and/r use the KW parameter. When an indexed file is created, yu must pen bth the data file that cntains yur recrds and the index file created by the system. \.. If yu mit the KEY= parameter, the system accesses the recrd with the next higher key than the last recrd accessed. This is called sequential access by key index. Yu can als cmbine the direct access by key and sequential access by key by specifying a KEY= parameter n the first access nly. This gives yu the recrds in ascending sequence beginning with the key specified in the KEY= parameter. If yu specify a key in a KEY= r KEY~ parameter that is lnger than the key in the key index file, the specified key is truncated t the length f the key in the index file. If yu specify a key that is shrter than the key in the index file, nly the characters yu specified will be used in the search. If the key field is made up f several parts, fr example, then yu culd access the first recrd n part f the key as shwn: I ",---.. Divisin -A, r~----a--- Department Emplyee Number Key Field 0010 DIM K$3,A$ K$= '003' 0090 READ FILE FL 1, KEY=K$,A$, IF A$=K$ THEN READ FILE FL1,A$, GOTO ("--- ~. The prgram wuld access the first recrd with divisin equal t 003 and then access all recrds with divisin 003 in sequence by key, assuming the master file is in ascending sequence by key. 76

81 _._ Index File Frmat: The index file cntains recrds whse nly cntents are the key value and the lcatin f the recrd in the master file cntaining that key. Recrds in the index file may be 8, 16, r 32 characters lng as shwn in the fllwing table: Key Length in Master File 1 t 4 characters 5 t 12 characters 13 t 28 characters Index File Recrd Length 8 characters 16 characters 32 characters There are tw types f recrds in the index file: key recrds and marker recrds. The key recrds cntain the key (frm the master recrd), which begins in psitin 1 f the index file recrd, and the master recrd number in the last fur psitins f the index file recrd. The frmat f the master recrd number is binary fixed pint (see FORM, B Parameter). If the key length is less than the key recrd length minus 4, the character psitins between the key and the recrd number are nt used. There are tw marker recrds in each index file. The first marker recrd cntains the hex 00 character in all recrd psitins except the last fur. The last fur psitins cntain tw 2-character fields. The first 2-characterfield cntains the length f the key field in binary fixed pint frmat. The secnd 2-character field cntains the starting psitin f the key field in the master recrd in binary fixed pint frmat. The secnd marker recrd cntains the hex FF character in all psitins except the last fur. The last fur psitins are nt used. The first marker recrd must be the first recrd in the index file. The secnd marker recrd is used t lcate the end f the srted prtin f the index file. The secnd marker recrd is the secnd recrd f the file until the file has been srted. In this psitin it indicates that there is n srted prtin in the index file. The recrds between marker recrds are assumed t be in ascending sequence by key. When yu specify a KEY=parameter, the index file is searched fr a key that satisfies the search cnditin (=, ~, r next sequential key). The keys between marker recrds can be searched rapidly because they are in sequence and because a wrk table can be used t shrten the prtin f the file t be searched (see KW= parameter under OPEN/OPEN FILE in Chapter 4). After the srted prtin f the index file has been searched, keys beynd the secnd marker recrd (if any) must be searched in rder, which is much slwer. When yu use the DELETE FILE statement, the recrd number field f the specified key recrd is set t zer and is nt cnsidered in the search. Hwever, if a DELETE FILE specifies that the recrd with KEY=XYZ is t be deleted, and a later WRITE FILE statement creates a new recrd in the master file with KEY=XYZ; the entry in the index file fr key XYZ is reused and will pint t the new recrd. The ld recrd, thugh still in the master file, is nt accessible using the index file. Data Cnstants, Variables, And Cncepts 77

82 Recrd I/O File Buffer Requirements The wrk area buffer required fr a recrd I/O file depends n the physical recrd length f the media (tape r diskette) and the lgical recrd length (data) in the file. Buffer space is allcated in multiples f physical recrd length. If lgical recrd length is less than physical recrd length and can be divided evenly int physical recrd length, ne buffer is allcated. If lgical recrd length is less than physical recrd length and cannt be divided evenly int physical recrd length, tw buffers are allcated. If lgical recrd length is greater than physical recrd length in an even multiple (tw, three, fur times physical length, fr example), an equal number f buffers are allcated. If lgical recrd length is greater than physical recrd length, but is nt an even multiple, buffers are allcated n the basis f the first multiple f physical recrd length that exceeds lgical recrd length plus ne physical recrd length. Fllwing are allcatin examples; assume that the physical recrd length is 512 characters fr each example. When the lgical recrd length is 32 characters, the buffer allcatin is 512 characters as shwn: Lgical Recrd 512 I I I Physical Recrd Buffer Allcatin When the lgical recrd length is 30 characters, the buffer allcatin is 1,024 characters as shwn: Lgical Recrd Physical Recrd,. Buffer Allcatin 512 1,024 Physical Recrd When the lgical recrd length is 1,024 characters, the buffer allcatin is 1,024 cha racters as shwn: r Physical Recrd. Lgical Recrd 512 Physical Recrd.. Buffer Allcatin 1,024 I,f" \ / 78

83 C) When the lgical recrd length is 515, the buffer allcatin is 1,536 characters as shwn: Lgical Recrd Physical Recrd 512 1,024 Physical Recrd Buffer allcatin Physical Recrd Nte that, due t limitatins f buffer space, a buffer allcatin greater than 768 when yu attempt t lad r save recrd I/O files will cause an errr message indicating insufficient strage space. 1,536 FILE FLS File FLS is a 35-byte, system-riented file that allws yu t indicate (with the WRITE FILE FLS statement) such infrmatin as cnsle cntrl, natinal character set selectin, and runding f numeric data. Als, yu can use the READ FILE FLS statement t access such data as ttal user wrk area in the system, ttal wrk area available fr variables and buffers, and ttal number f lines printed. Yu can use the WRITE FILE statement referencing file FLS t indicate the fllwing infrmatin." Clumn 1 f file FLS indicates: c.) Character 'N' 'F' 'S' 'A' 'Q', l' '2' '3' '4' '5' '6' '7' '8' '9' '0' 'I',*' '+' Als see Natinal Character Sets. Meaning Turn n the display screen. Turn ff the display screen (this increases prcessing speed). Sund audible alarm (if installed) and leave it n. Sund the audible alarm fr apprximately ne quarter secnd. Turn ff the audible alarm. Select EBCDIC character set. Select Austria/Germany character set. Select Belgium character set. Select Brazil character set. Select Denmark/ Nrway character set. Select Finland/Sweden character set. Select France character se~. Select Italy character set. Select Japan character set. Select Prtugal character set. Select Internatinal character set. Select Spain character set. Select Spanish Speaking character set. Select United Kingdm character set. Select French Canadian character set. Any ther character entered in clumn 1 will be ignred. Data Cnstants, Variables, And Cncepts 79.. _---_._ _---_.

84 Clumn 2 f file FLS indicates keybard peratin as fllws: Character 'U' 'L' Meaning Select standard BASIC character mde n the keybard (this is the nrmal default). Select lwercase character mde n the keybard. / Any ther character entered in clumn 2 f the buffer will be ignred. Clumn 3 changes statement trace peratins asfllws: Character 'N' 'F' Meaning Turn n statement trace (see RUN Cmmand). Turn ff statement trace. I II. ~. Any ther character entered in clumn 3 will be ignred. Clumn 4 changes statement trace t the printer (see RUN Cmmand as fllws: Character 'N' 'F' Meaning Turn n trace t the printer (trace must already be n). Turn ff trace t the printer. Clumns 5 and 6 allw yu t specify a 2-character numeric value (a leading blank is valid) fr runding f numeric data (see RD = Cmmand). If clumns 7 thrugh 9 cntain FLx (where x is 0-9) f a stream I/O input file, subsequent input t character variables includes leading blanks and all cmmas and qutatin marks. Thus, entire lgical recrds can be read int character variables. If the file referenced (FLx) was pen n device '001', bth GET and INPUT statements will be effected. Clumns 10 and 11 allw yu t set spacing cntrl fr printed lines. The printer spacing increment is 1/96 inch. Thus, 16 increments prvide printing at the nrmal 6 lines per inch, 12 increments prvide 8-line-per-inch spacing (96/12), 32 increments prvide 3-line-per-inch spacing (96/32), and s n. 80

85 ------_..._-_._ _ _.._.. C) Yu can enter a value f DO, r a value f 08 thrugh 99. An entry f 00 suppresses spacing, and an entry f 08 thrugh 99 indicates the number f spacing increments fr each line printed. If yu enter 01 thrugh 07, nrmal 6-line-per-inch printing will ccur (the entry 01 thrugh 07 is ignred). If yu enter 08, 09, r 10, the printer prints ver the last line printed. Fr example, if yu enter 08, the printed utput is as shwn in the fllwing example: 0010 PRINT FLP, 'VAVAVAVAVAVAVAVAV4V4VAV4V6VAVAVAVAVAVAV4VAV4V' 0020 WRITEFILE FLS,' 0030 PRINT FLP, 'V4V4VAVAVAVAVAVAV4V4V4VAVAVAVAVAVAVAVAV4V4VAV' OO~O PRINT FLP, 'VAV4VAV4VAV4VAVAV4V4VAV4VAVAVAVAVAVAVAVAV4VAV' VAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAVAV ~~~~~~~~~~~~~~~~ij~~~~~~a~a~a~a~a~a~~~~~a~a~a~ Yu can use clumns 21 thrugh 35 t hld any data using the WRITE FILE statement. G C) Data Cnstants, Variables, And Cncepts 81

86 Yu can access the fllwing infrmatin using the READ FILE statement referencing file FLS: Bytes Meaning Indicates the ttal area available in the system Indicates the available user wrk area fr variables and buffer usage Indicates the line number f the last line printed n file reference FLP Reserved Indicates the return cde (0-255) last set by the RC= parameter in the latest STOP r END statement /- \ '. " '- 82

87 0 Natinal Character Sets As shwn in the descriptin f file FLS, yu can select frm several natinal character sets fr prcessing n yur These natinal character sets can als be selected frm the keybard whenever the keybard is pen fr input. The fllwing chart shws each natinal character set, the crrespnding key that yu must press t select the character set, and the resulting characters that change accrding t the character set selected. (/"'-" ",-_J Press the HOLD key, T select then hld dwn the this natinal SH I FT key and press: character set: These characters change: C~ I Hex Psitin L~A ~5A ~;B ~,:;F 6A 79 7B 7C Ai CO DO EO Austria/Germany P- O $ 1\ 0» f:\ a u (:) 2 Belgium [ ] ~~ 1\ U tt c'fi e e' g 3 Brazil ~:: $ ~~ 1\ g a C) A tj 0 'e \ 4 Denmark/Nrway tt :0: A 1\ fe ~ u ~ <'3 \ 5 Finland/Sweden :0: 1-. 1\ 0 'e A 0 u a it E 6 France l/ 7 Italy () () $ A U t a 'e e g 'e ~; 1\ ri \; f.. \' ii e ~. 8 Japan i -( )- $ 9 Prtugal 1, 1\ 0 A 6 g a ~~ 0 Internatinal [ ~~ A tj -( )- \ / Spain f~ -( )- \ * Spanish Speaking $ i1 -( )- \ United Kingdm $ -( )- \ C~) + French Canadian <l ~~ A t; 'e e ) C EBCDIC <!: ~; tj -( )- \ Data Cnstants, Variables, And Cncepts _-_.._-_ _ _-"... ".. _._---_ _._-----_... "'""""""'"...

88 PROCEDURE FILE The prcedure file is a user-generated, recrd I/O tape r diskette file. Yu can create a prcedure file just as yu create a recrd I/O data file using the LOADO,DATA cmmand. A prcedure file can cntain cmmands, BASIC statements, and data t be used by the prgram fr input. Recrd length in the prcedure file is up t 64 characters. Use f a prcedure file is initiated by a PROC cmmand, which causes the file t be pened implicitly. Recrds frm the file are then laded int a buffer area and sequentially executed as if they had been entered frm the keybard. When a recrd in the buffer has been executed, anther recrd is laded frm the prcedure file and used. The SKIP and CSKIP cmmands allw selective use f recrds in a prcedure file. The uncnditinal SKIP instructs the system t pass ver a specified number f recrds. The cnditinal CSKIP instructs the system t test a cnditin (return cde) frm the STOP r END statement in the last prgram executed, then t pass ver a specified number f recrds depending n the cnditin. The ALERT cmmand allws yu t prvide an indicatin t the peratr that interventin is needed during executin f the prcedure file. Data in a prcedure file can als be used as input supplied in respnse t an INPUT statement if the RUN cmmand fr the prgram included the IN=P parameter. Like all recrds in a prcedure file, data recrds have a maximum length f 64 characters. Als, each value assigned frm a prcedure file must be f the same type (character r numeric) as the variable t which it is assigned in the I N PUT statement. " " 84

89 C) C) C) In the fllwing example, the prcedure file cntains a series f recrds that will cause several BASIC prgrams t be laded and executed. UTIL SYS 080 Lad 'BUILD' Run IN=P D40,0,'NEWFILE' CSKIP 5 Lad 'READY.SORT' RUN UTIL SORT Set the default device. Lad the BUILD prgram. Start BUILD; data fr input is taken frm the prcedure file. This is data fr an input statement. If BUILD sets a nnzer return cde, skip five recrds in the prcedure file, therwise get the next recrd. If the CSKIP did nt bypass recrds, lad prgram READY.SORT. Execute READY.SORT. Transfer cntrl t the srt feature. FILE NEWSORT,I,SORT.CTL,1 This recrd is passed t the srt prgram (see IBM 5110 Custmer Supprt Functins Reference Manual). SKIP 2 Lad 'NOSORT' RUN Alert change diskette in drive 2 PROC 'PROC2' Bypass the next tw recrds. If the CSKIP bypassed recrds, lad prgram NOSORT. Execute NOSORT. Pause t let the peratr change the diskette. Start anther prcedure. C --, 'I j Data Cnstants, Variables, And Cncepts 85,

90 ...,,,~' \ c 86

91 C) Chapter 4. BASIC Statements BASIC statements allw yu t enter data and specify hw that data is t be manipulated and what the utcme is t be. BASIC statements are either executable r nnexecutable. Executable statements cause a prgram actin, such as value assignment r printing. Nnexecutable statements describe infrmatin needed by the prgram and the user, but cause n visible actin. Executable and nnexeutable statements can be intermixed when a BASIC prgram is entered frm the keybard. The maximum number f statements permitted in a single BASIC prgram is limited nly by the user wrk area size f the system and by the statement types. Each statement in a BASIC prgram must begin with a statement number. The number determines the rder f executin f the statements in the prgram. All statements are executed in numeric rder, regardless f the rder in which they were entered, unless the sequence f executin is altered by branches, lps, r subrutines. (,-" \ /" The allwable range f statement numbers fr a BASIC prgram is frm 1 thrugh Yu d nt have t enter preceding zers (0020, fr example) because the system maintains statement numbers as fur-psitin integers and inserts preceding zers fr statement numbers f less than fur digits. Statement Lines A BASIC statement preceded by a statement number is called a statement line. Statement lines are entered frm the keybard (ne per display line) with a maximum f 64 characters. Statements cannt be split between tw display lines, nr can there be mre than ne statement n each display line. A typical statement line is as shwn. 10 LET A = 2+2 Statement ~ ~ASI~ Number Statement In this chapter, all the BASIC statements are presented alphabetically in the syntax used fr BASIC cmmands, except the statements dealing with matrix peratins. These statements are discussed at the end f the chapter under Matrix Operatins. I BASIC Statements 87

92 Desk Calculatr Operatins Yu can perfrm several desk calculatr peratins using BASIC statements withut preceding statement numbers. These peratins are executed immediately after yu press the EXECUTE key. Desk calculatr peratins include: Assignment f values t variables (bth character and numeric) withut the keywrd LET PRINT (t display) and PRINT FLP (t print) statements MAT PRINT and MAT PRINT FLP statements DIM statements t dimensin arrays and variables Character and numeric expressins MAT assignment statements BASIC STATEMENT LISTING The statements used in the BASIC language fr the system are listed belw. A brief descriptin f each statement is included. CHAIN-Ends a prgram, then lads and begins executing anther prgram. CLOSE [FILE ]-Deactivates pen files. DATA-Creates an internal data table f values yu supply. DEF-Defines a functin t be used in the prgram. DELETE FILE-Remves a specific recrd frm a key-indexed file. DIM-Specifies the size (dimensins) f an array r character variable length. END-Ends a prgram. EXIT-Specifies errr exits fr crrespnding I/O errr cnditins. FNEND-Ends a functin defined in a DEF statement. FOR-Begins a lp. FORM-Specifies frmat fr displayed/printed utput and recrds in files. [ MAT] GET-Assigns values frm a stream I/O file t variables r array elements. GOSUB-Branches the prgram t the beginning f a subrutine. GOTO-Branches the prgram t a specific statement. 88

93 _..._ IF-Branches the prgram depending n specific cnditins. :Image-Specifies frmatting f data t be displayed r printed. [MAT] INPUT-Assigns values frm the keybard t variables r array elements during prgram executin. LET-Assigns values t variables. MAT Assignment-Assigns values t all elements f an array. NEXT-Ends a lp (see FOR and NEXT). C " ) OPEN-Activates stream files fr input r utput. OPEN FILE-Activates recrd files fr input/utput and access methd. ONERROR-Specifies errr recvery rutine fr debugging. PAUSE-Interrupts prgram executin. [MAT] PRINT (FLP}-Displays r prints the values f specified variables, expressins, array elements, r cnstants. [MAT] PRINT USING (FLP}-Displays r prints the values f specified variables, array elements, expressins, r cnstants in a frmat defined in an image r FORM statement. [ MAT] PUT-Writes the values f specified variables, expressins, r array elements int a stream I/O file. [MAT] READ-Assigns values frm the internal table (see DATA) t variables r array elements. [MAT] READ FILE [USING ]-Assigns values frm recrd I/O files t variables. REM-Inserts cmments r remarks int a prgram. [MAT] REREAD FILE [USING]-Allws reaccess t the last recrd read frm a file. RESET-Repsitins a file t its beginning, t its end, r t a specific recrd. RESTORE-Causes values in the internal data table (see DATA) t be assigned starting with the first table value. RETURN-Ends a current subrutine r user functin. [MAT] REWRITE FILE [USING]-Allws change/update t recrd I/O files. STOP-Ends a prgram. (_... \ U USE-Saves variables t be used by successive prgrams. [MAT] WRITE FILE [USING ]-Adds recrds at the end f a recrd I/O file. BASIC Statements 89

94 CHAIN 'dev-address'} ex { p char-var ' CHAIN The CHAI N statement perfrms the fllwing sequence: 1. Ends the prgram currently being executed 2. Lads a new prgram 3. Begins executing the new prgram The syntax f the CHAI N statement is as shwn abve, where: 'dev-address' is the address f the device cntaining the next prgram t be laded and executed. See Device Address Parameter. char-var is a character variable t which yu have assigned a device address. expressin can be an arithmetic r character expressin. An arithmetic expressin specifies the number f the file t be laded: A character expressin specifies the name f the file t be laded. Upn executin, all pen files in the current prgram are clsed. The prgram in the file (determined by the expressin r cnstant) n the device specified is then laded and executed starting with the lwest statement number. Fr example: 0110 CHAIN 'EBO',14 In this statement, the prgram in file number 14 n device' EBO' is laded and executed when this statement is executed. Ntes Abut CHAIN When used in cnjunctin with the USE statement, the CHAI N statement allws variable values t be maintained frm ne prgram t the next (see USE statement). The CHAIN statement can als be used t chain t a prcedure file (see Prcedure File, Chapter 3). When the expressin value is character and begins with.proc, the CHAIN statement clses all files and places the expressin value (except fr the leading.), a cmma, and the device cde enclsed in qutes n line 1 f the display screen. The system then prcesses the result as a PROC cmmand. 90

95 _.._... Fllwing is an example f a CHAIN statement: 60 A$='DBO' 70 B$='.PROC4' BO CHAIN A$, B$ In this example, the system will chain t the furth file (the prcedure file) n diskette drive 1. Nte that the perid preceding PROC4 in statement 70 is necessary t distinguish PROC4 frm anther valid file name when the CHAIN statement is executed., ) \~ BASIC Statements 91

96 CLOSE [F I LE] file-ref [, file-ref]... [,EXIT line-num] )] [{[,EOF line-num] [,IOERR line-num] CLOSE The CLOSE statement specifies files t be deactivated. An implicit CLOSE statement is autmatically executed fr each active file at the end f prgram executin. The syntax f the CLOSE statement is as shwn abve, where: FILE is specified when files t be clsed are recrd I/O files nly. Recrd I/O files are thse with fixed-length recrds. file-ref is frm FLO t FL9 and represents the same file specified in the OPEN statement. Only ne file reference is required. EOF, IOERR, and EXIT are errr recvery exits, which direct the prgram t branch t the specified line number upn the ccurrence f the indicated errr (see EXIT statement). Ntes Abut CLOSE If a stream I/O file is used fr bth input and utput peratins during executin f a single prgram, the file must be clsed and repened between input and utput references. If yu d nt clse a file (CLOSE r end 'f prgram), the file may becme unusable. If a file specified in a CLOSE statement is nt active when the CLOSE statement is executed, the statement is ignred. The file references must be the same as thse specified fr the files in the OPEN statement. Examples.A sample CLOSE statement is as shwn: CLOSE FL2, FL9 A sample CLOSE statement with errr exits is as shwn: 0030 CLOSE FL5, FL8, EOF 0090, 10ERR

97 .._ _.._..._.._..._ _._......_ DATA {arith-cn } [ {arith-con}]... char-cn 'char-cn DATA C) The DATA statement is a nnexecutable statement that causes an internal data table t be created. The data table cnstants are supplied t variables and array elements specified in crrespnding READ r MAT READ statements. The syntax f the DATA statement is as shwn abve, where: cn is an arithmetic r character cnstant. Only ne cnstant is required. At the beginning f prgram executin (befre any executable statements are executed), a table cntaining all the cnstants frm all the DATA statements (in their rder f appearance by statement number) is built. At the same time, a pinter is set t the first cnstant in the table. The pinter is advanced thrugh the table, cnstant by cnstant, as the data is supplied t READ r MAT READ statement variables. (The pinter can be changed t pint t the first cnstant again by the RESTORE statement.) The length f character cnstants t be assigned t character variables is limited nly by line length (64 characters). Ntes Abut OAT A Each cnstant in a DATA statement must be f the same type as that specified fr the variable t which the cnstant is t be assigned in the crrespnding READ statement. Thus, if the third cnstant in a DATA statement is a character cnstant, then the READ statement variable t which it is assigned must als be a character variable. DATA statements can be placed anywhere in a prgram, either befre r after the READ statement t which they supply data. C) An errr will ccur if DATA statements d nt cntain enugh cnstants fr the READ statements issued. DATA statements cannt be used in a prgram assigned t ne f the functin keys. Character data need nt be enclsed in single qutatin marks unless leading blanks and/r embedded cmmas are significant. DATA statements are nt checked fr crrect syntax. BASIC Statements 93

98 Example A sample DATA statement is as shwn: 110 DATA'BILL',21.60,'CHARGE',15.40 In this example, the character cnstants (BILL and CHARGE) and the arithmetic cnstants (21.60 and 15.40) are inserted int the internal data table. (' \...,' 94

99 DEF FNfunctin name [$] ~ { :~~~_:::} [. { :~:~_::: }] _.. ) ] [ =arith-exp ] ~ {arith-var} [{ arith-var}]... )] [=Char-exp] L.: char-var 'char-var C) c) RETURN {(arith-ex p )} (char-exp) FNEND[ cmment] DEF,RETURN, FNEND The DEF statement is nt executable, but infrmatinal. This statement allws the user t define an arithmetic r character valued functin fr reference elsewhere in the prgram. The FN EN 0 statement indicates the end f the functin, and the RETURN statement specifies the value f the functin. The syntax f the DEF statement can be either a single line r multiline functin. (The syntax f the FNEND and RETURN statements are shwn after the DEF statement syntax.) c) Single Line Functin DEF FNfunctin name r$] ~ {arith-var} l: L ;l char-var [ { arith-var} ]... [= {arith-exp }] 'char-var J char-exp where: functin-name is any character f the extended BASIC alphabet. This character with FN is the name f the defined functin. Fr character valued functins, this character must be fllwed by a dllar sign ($). (arith-var) is a simple arithmetic variable t which a value will be assigned when the functin is called (these must be enclsed in parentheses). (char-var) is a character variable t which a value will be assigned when the functin is called. Assigned values cannt exceed 18 characters. Lnger 'values will be truncated, and shrter values will be padded with blanks. arith-exp, char-exp is an arithmetic r character scalar expressin that specifies the value t be returned fr the functin. A character expressin must be specified if the functin name is a character variable. Likewise, the expressin must be arithmetic fr an arithmetic functin name (FNA). BASIC Statements 95

100 Sample single-line DEF statements are shwn belw: 120 DEF FNA(R)=2*R DEF FNA$ (R)=CHR(R+5) Multiline Functin DEF FNfunctin name [$J ~ {arith-var} [{arith-var}]... ~ L char-var 'char-var J \.'''' where: functin-name is any character f the extended BASIC alphabet. This character with FN is the name f the functin. Fr character valued functins, this character must be fllwed by a dllar sign ($). / " (arith-var) is a simple arithmetic variable that receives a value when the functin is referenced. These ptinal variables must be enclsed in parentheses. (char-var) is a character variable t which a value will be assigned wrren the functin is called. Assigned values cannt exceed 18 characters. Lnger values will be truncated, and shrter values will be padded with blanks. RETURN {(arith-ex p )} (char-exp) where: arith-exp, char-exp is an arithmetic r character scalar expressin that specifies the value f the user-defined functin t the referencing functin. This expressin must be f the same type (arithmetic r character) as the functin'defined. FNEND[ cmment] The FN EN 0 statement is nnexecutable and simply indicates the end f a multiline functin. The value f the functin is specified in an expressin in a RETURN statement. The cmment is ptinal. When a reference t a user-defined functin is encuntered during prgram executin, the value f each parameter in the expressin is used t initialize the crrespnding variable. The ptinal variables must match the number and type specified in the functin reference. If 'the expressin is present, the functin is defined n the ne line and its value is the value f that expressin. This is a single line functin. If the expressin is nt specified, the DEF statement is the start f a multiline functin. In this case, the FNEND statement indicates the end f the functin and the value f the functin is specified in an expressin in a RETURN statement. 96

101 ----_ C) C) Ntes Abut DEF A functin can be defined anywhere in a BASIC prgram, either befre r after it is referenced. A functin f a given name can be defined nly nce in a given prgram. A functin cannt cntain references t itself r t ther functins that refer t it in their definitins. The expressin in the RETURN statement is required fr multiline functins (see GOSUB and RETURN). A functin reference t a user-defined functin can appear anywhere in a BASIC expressin that a cnstant, variable, subscripted array element reference, r system functin reference can appear (except desk calculatr peratins). The variables have a special meaning in the DEF statement. Cnsequently, it is pssible t have a variable with the same name as a simple variable used elsewhere in the prgram. Each is recgnized as being unique, and n cnflict f names r values results frm this duplicate usage. The maximum number f user-defined functins in a prgram is 29, and the maximum number f nested functin references varies accrding t the cmplexity f the referencing statement. (I... -_/ User-defined functins that are referred t during an input r utput peratin cannt themselves perfrm any input r utput. After cntrl is passed t a DEF statement withut reference t the functin, cntrl ges t the first executable statement fllwing the functin definitin-fllwing the DEF statement fr single-line functins, and fllwing the FNEND statement fr multiline functins. The last executable statement preceding the FNEND statement shuld be a RETURN, STOP, CHAIN, r uncnditinal GOTO t prevent cntrl frm passing t the FN EN D statement. If a functin definitin alters the value f a variable that is referenced in the same statement that calls the functin, unpredictable results may ccur. A functin may be defined in and referenced frm a functin key grup. When a functin is referenced frm a key grup, the system searches the current chain f statements, then the mainline prgram and definitins fr keys 0-9 in rder t find the functin referenced. BASIC Statements 97

102 Example The fllwing examples illustrate the executin f DEF statements: 10 DEF FNA (X) = Xt3/2 20 Y = Z = FNA(Y) After executin f statement 30, the variable Z will have the integer value 500. In the next example, the variable R will have the integer value 72 after executin f statement 80. When statement 80 is executed, the current value f Y, which is 2, is substituted fr each ccurrence f the dummy variable X in the arithmetic expressin f statement 100. Since the functin FNC, defined in statement 100, uses the functin FN B in its definitin, the value 2 is substituted fr each ccurrence f X in the arithmetic expressin f statement 90. The resulting value, 47, is then substituted fr the functin reference FNB(X) in statement 100. The current value f Y, which is 2, is then added t 47, and the resulting value f 49 is substituted fr the functin reference FNC(Y) in statement 80. This value is added t 23, and the resulting value f 72 is assigned t the variable R. 70 LET Y = 2 80 LET R = FNC(Y) DEF FNB(X) = 5*X** DEF FNC(X) = FNB(X) + X The fllwing example shws a multiline functin definitin. When these statements are executed, bth C and D will have a value f 7. '...,._- 10 A = 5 20 B = 2 30 DEF FNA (X,Y) 40 IF X>O GOTO RETURN X-V 60 RETURN X+Y 70 FNEND 80,C = FNA (A,B) 90 D = FNA (A,B) In the fllwing example, the functin returns the character string 'X SQUARED=4' when X=Z: 'I.,...,. 010 DEF FNA$(X) = 'X SQUARED='11 CHR (Xt2) 98

103 C] DE LETE FILE file-ref,key=char-var [, EXIT line-num], }] [{[,IOERR line-num] [,NOKEY line-num] DELETE FILE Yu can use the DELETE FI LE statement t lgically delete a recrd frm the index table accrding t the key field yu specify. See Key Indexed Access under Data Files and Access Methds. After the recrd is deleted, the file is psitined t a lcatin immediately fllwing the deleted recrd. The syntax f the DELETE FILE statement is as shwn abve, where: file ref is FLO t FL9 t identify the file cntaining the recrd t be deleted. KEY=char-var specifies the key field in the recrd t be deleted. The file is searched fr a matching key field, and the crrespnding recrd in the index file is then deleted (see Key Indexed Access in Chapter 3). EXIT, NO KEY, and IOERR are errr cnditins and assciated line numbers t which prgram cntrl will transfer if the errr ccurs. EXIT is the line number f an EXIT statement, NOKEY indicates that a recrd with the specified key. field cannt be fund, and IOERR indicates that a hardware errr prevents cmpletin f this DELETE FILE statement. Ntes Abut DELETE FILE The NOKEY and IOERR errr cnditins can be entered in any rder. The file referenced in a DELETE FI LE statement must have been pened with the ALL parameter in the OPEN FILE statement (see OPEN FILE statement). Otherwise, the DELETE FILE statement will cause an errr. Example C) A sample DELETE FILE statement is shwn belw: 80 A$=' ROWE' 90 DELETE FILE FL8,KEY=A$,NOKEY 999 In this example, the recrd with a key field equal t ROWE in file FL8 will be deleted. If the specified recrd cannt be fund, prgram cntrl will transfer t statement 999. BASIC Statements 99

104 arith-arr-name (rws [,cl] ) }] DIM char-arr-name [len] (rws [,cl] )... [{, char-scalar name [len] DIM The 01 M statement allws yu t explicitly specify the size f arrays and character variables. The syntax f the DIM statement is as shwn abve, where: /' -, ".... arr-name is an arithmetic r character array t be dimensined. char-scalar is a character variable t which a length will be assigned. rws,cl are nnzer, unsigned integer cnstants specifying the dimensins f the arrays. One-dimensinal arrays require nly the rws entry. Tw-dimensinal arrays require bth rws and clumns entries separated by a cmma. len is the length f a character scalar, r the length f each element f a character array. This value can be frm 1 t 255. A ne-dimensinal array whse name is specified in a DIM statement is defined as having the number f elements represented by the rws entry. A tw-dimensinal array whse name is specified in a DIM statement is defined as having the number f rws and the number f clumns entered in the statement. The initial value f each arithmetic array element is zer; each character array element is initialized t blanks. If len is nt specified, the default length f each character array element and character variable is 18 characters. Ntes Abut DIM An array name cannt appear in a DIM statement if it has been previusly defined, either implicitly r explicitly, in a USE statement r a prir 01 M statement. An arithmetic r character array f ne r tw dimensins can be defined in a DIM statement. The maximum permissible size f each dimensin in an array is Len can be specified as less than r equal t 2.55 characters. 100

105 \ Example A sample DIM statement is as shwn: 20 DIM Z$18(5), A(4,2), P$50 () The result f the preceding statement is: Z$ = five strings (array elements) f 18 blank characters each. Array A has fur rws f tw clumns each: c) 0 0 Character variable P$ has a length f 50 blank characters. (:.-) 0 -- ""\ BASIC Statements _..... _... _._-----

106 END [{cmment }] RC=arith-exp END The END statement allws yu t specify the lgical end f a BASIC prgram and t terminate prgram executin. The syntax f the EN D statement is as shwn abve, where:./< \... -' cmment is ptinal. RC = arith-exp is the return cde used by the CSKIP cmmand (see Prcedure Files). This cde can be accessed frm file FLS (see File FLS in Chapter 3). The EN D statement signifies that the prgram shuld be ended. It can be entered anywhere in a BASIC prgram. When an END statement is encuntered during executin f a prgram, it causes all pen files t be clsed and it terminates prcessing. The actins f the END statement are identical t thse f the STOP statement. Ntes Abut END The END statement is ptinal. If mitted, END is assumed by the system t fllw the highest-numbered statement in the prgram. When yu list the prgram (see LIST Cmmand), the'system displays r prints a STOP statement t replace any END statement. If the value f the RC= parameter is less than zer r greater than 255, a value f zer is assumed. If RC= is nt specified, the return cde is set t zer. Example A sample END statement is as shwn: 0910 END PG4 102

107 0 EXIT EOF IOERR DUPKEY NOKEY CONY NOREC line-num EOF IOERR DUPKEY, NOKEY CONY NOREC line-num (~~) EXIT The EXIT statement allws yu t grup in a single statement thse errr cnditins (and their subsequent recvery line numbers) that can ccur during the executin f input/utput peratins t files. The EXIT statement is nnexecutable and merely serves as a guide t the prgram, indicating the line number t which prgram cntrl shuld transfer if an assciated errr shuld ccur. If the EXIT parameter is entered fr input/ utput statements, prgram cntrl is transferred t the line number f the EXIT statement when an errr ccurs. The prgram then selects the apprpriate errr cnditin and transfers cntrl t the crrespnding line number as entered fr the EXIT statement. The syntax f the EXIT statement is as shwn abve, where: EOF, IOERR, DUPKEY, NOKEY, CONV, and NOREC are the errr cnditins that will transfer prgram cntrl t their assciated line number if the EXIT parameter in the input/utput statement specifies a branch t this EXIT statement. Fr the varius input/utput statements, these errr cnditins have the fllwing meanings: EOF Fr a GET statement, this errr indicates that insufficient data remains in the file. Fr a READ FILE statement, this errr indicates that there are n mre recrds in the file. Fr a PUT, WRITE FILE, PRINT, r CLOSE[FILE] statement, this errr indicates that there is insufficient file space t accmmdate the data specified. (J C) IOERR DUPKEY NOKEY Fr all input/utput statements, this errr indicates that a hardware errr has prevented cmpletin f the statement. Fr WRITE FILE statements specifying a key-accessed file, this errr indicates that a recrd with the same key already exists in the referenced file. Fr READ FILE, REWRITE FILE, DELETE FILE, and RESET FI LE statements, this errr indicates that n recrd matching the specified key can be fund in the referenced file. BASIC Statements _.. _.._-'''

108 CONV Fr input/utput statements referencing stream I/O files, this errr indicates that a field cannt be cnverted t the type f variable specified. Fr input/utput statements referencing recrd I/O files, this errr indicates ne f the fllwing: A value in a list f data cannt be cnverted t the frmat defined in the specified FO RM statement. There are insufficient value inthe recrd fr the data items listed in the statement. There is insufficient space in the recrd t utput the data items listed in the statement. A FO RM specificatin specifies a psitin utside the defined recrd. A FORM statement referenced by a PR INT statement cntains a frmat ther than PIC r C. ".. NOREC This errr indicates that the specified relative recrd number (in statements referencing recrd I/O files) is zer, negative, r greater than the relative recrd number f the last recrd in the file. Ntes Abut EXIT Each errr cnditin can be entered nly nce in an EXIT statement. Errr cnditins can be entered in any rder. Example A sample EXIT statement is shwn belw: 80 EXIT EOF 200,IOERR 220,NOKEY 240,NOREC 260 I n this example, an input/utput statement referencing line number 80 fr the EXIT parameter will cause prgram cntrl t transfer t line number 200 if an EOF cnditin caused the errr, t line number 220 if an 10ERR caused the errr, t line number 240 if the specified key culd nt be fund, r t line number 260 if the errr was caused by an imprper relative recrd number. I.~',. ;/- " i\.. 104

109 ---_..._ _ _..._... ".'-'-".._' FNEND [cmment] FNEND Fr a cmplete descriptin f the FNEND statement, see DEF, RETURN, FNEND. G BASIC Statements 105

110 FOR cntrl-var=arith-exp TO arith-exp [STEP arith-expj NEXT cntrl-var I FOR AND NEXT Tgether, a FOR statement and its paired NEXT statement delimit a FOR lp-a set f BASIC statements that can be executed a number f times. The FOR statement marks the beginning f the lp and specifies the cnditins f its executin and terminatin. The NEXT statement marks the end f the lp....,.. The syntax f the FOR and NEXT statements is as shwn abve, where: cntrl-var is a simple arithmetic variable. arith-exp are expressins that specify an initial value fr the cntrl variable, the final value f the cntrl value (at which executin f the lp will end), and the amunt that the cntrl variable will increase after each executin f the lp. If STEP and the last arithmetic expressin are mitted, an increment f 1 is assumed. Upn executin f these statements, all expressins are evaluated. The initial value f the cntrl variable is tested against the final value f the cntrl variable. If the initial value is greater than (less than fr negative increments) the final value, the lp is nt executed. Instead, the value f the cntrl variable is left unchanged, and cntrl ges t the statement fllwing the N EXT statement. If the lp is executed, the cntrl variable is set equal t the initial value, and the statements in the lp are executed. When the NEXT statement is executed, the specified increment is added t the cntrl variable, which is then cmpared with the specified final value. If the cntrl variable is still less than (greater than, fr negative increments) r equal t the final value, the lp is executed again and the cycle cntinues until an increment is made that renders the cntrl variable greater than (less than fr negative increments) the specified final value. At that time, the cntrl variable is set back t its last value, and cntrl falls thrugh t the first executable statement fllwing the N EXT statement. Ntes Abut FOR and NEXT If the ptinal STEP arithmetic expressin is mitted in the FOR statement, the increment value is autmatically set t +1. The value f the cntrl variable can be mdified by statements within the FOR lp, but its initial value, final value, and increment are established during the initial executin f ~he FOR statement and are nt affected by any statement within the FOR lp. 106

111 ._----."... ''''----" _- C) If the initial value t be assigned t the cntrl variable is greater than (less than fr negative increments) the final value when the FOR statement is evaluated, the lp is nt executed, n value is assigned t the cntrl variable, and executin prceeds with the first executable statement fllwing the assciated N EXT statement. If the value f the STEP arithmetic expressin is zer, the FOR lp is executed an infinite number f times, r until the value f the cntrl variable is purpsely set beynd the specified final value. Transfer f cntrl int r ut f a FOR lp is permitted; hwever, a NEXT statement cannt be executed unless its crrespnding FOR statement has been executed previusly. FOR lps can be nested within ne anther as lng as the internal FOR lp falls entirely within the external FOR lp (see the fllwing example). Nested FOR lps shuld nt use the same cntrl variable. The maximum number f nested FOR lps is 15. Example The fllwing example shws a simple FOR lp that increases the cntrl variable by 2 until the value f 25 is exceeded. (,, FOR I = 1 TO 25 STEP 2 90 NEXT I The next example shws the crrect technique fr nesting FOR lps. The inner lp is executed 100 times fr each executin f the uter lp. 10 FOR J = A TO B STEP C 150 Fa R K = 1 TO NEXT K C-~ I./ \ I 300 NEXT J BASIC Statements 107

112 FORM The FORM statement allws yu t specify a frmat fr bth printed/displayed utput and recrds in recrd I/O files. Fr the purpse f explanatin, the FORM statement will be described as tw separate statements: print frmatting with the FORM statement, and recrd frmatting with the FORM statement. Print Frmatting with the FORM Statement When used t frmat printed utput, the FORM statement has the fllwing syntax: pas r{i n~eger }] L anth-var x r{integer }] L arith-var FORM SKIP [{in~eger}l anth-var J 'char-cn' rfi nteger } ] { L\ arith-var *, C QntegerJ PIC {~pecifier} ( Insert-char... [i IIIJ )} where: POS indicates the psitin in the line fr the next value t be printed r displayed. This entry can be frm 1 t the extent f line length. Yu can specify an integer cnstant r arithmetic variable fr line psitin. If the truncated value f yur entry is less than 1, this cntrl specificatin is nt used. If yur entry exceeds ttal line length, the current line is displayed r printed, and line psitin is reset t the first psitin f the next line. Default value fr this parameter is 1. X indicates the number f blanks t be displayed r printed. This parameter allws yu t insert blank fields int displayed r printed data. Default value fr this parameter is 1., '-.. SKIP indicates the number f lines t be skipped when yu are displaying r printing data. After the current line is printed r displayed, the next line begins at the SKI P value yu entered, minus 1 (fr the current line). Thus, if yu enter 10 fr SKI P, the system displays/ prints the current line, then skips 9 lines, psitining the next line at line number 11. After the SKI P peratin, the next utput begins at the first psitin in the line. Default value fr this parameter is 1. (-.. \, 108

113 'char-cn' are character cnstants (enclsed in single qutatin marks) that will be written exactly as entered when the FORM statement is used. If the character cnstant is used in a FORM statement fr input, it will cause the crrespnding psitins in the recrd t be skipped ver; fr example, Xn, where n is the. length f the character cnstant. integer jarith-var* indicates the replicatin factr fr the data frmat that fllws. This value indicates the number f times that the data frmat shuld be used. Thus yu can use the same frmat repeatedly. This parameter must be greater than O. C indicates the length f a displayed r printed field int which a crrespnding character expressin (in the PRINT statement) is t be utput. The character expressin is truncated r filled with blanks n the right t the length yu enter fr C. Default value fr this parameter is the length f the character expressin in the PRINT statement. PIC indicates the length and cnversin fr a displayed r printed field int which a crrespnding numeric expressin (in the PRINT statement) is t be utput. The PIC parameter can be up t 32 characters cntaining three specificatins: the digit specifier, the insertin character, and the expnent specifier. C "\ ) BASIC Statements 109

114 Digit Specifier The digit specifiers are: Specifier # z * $ + Meaning A digit must always appear in this psitin. Replace a leading zer with a blank. Replace a leading zer with an asterisk. Flating dllar sign. A dllar sign is t be printed immediately befre the first significant digit. Flating sign. A plus sign fr a psitive number, r a minus sign fr a negative number, is t be printed immediately befre the first significant digit.... CR Flating minus sign. A plus sign fr a psitive number, r a minus sign fr a negative number, is t be printed immediately befre the first significant digit. These psitins can be used at the end f the PIC string t indicate a credit amunt. If the value is negative, the characters CR will be printed after it. If the value is psitive, the characters CR are replaced with tw blanks. DB These psitins can be used at the end f the PIC string t indicate a debit amunt. If the value is negative, the characters DB will be printed after it. If the value is psitive, the characters DB are replaced with tw blanks. 110

115 () The fllwing are examples f digit specifiers. Assume a data item value f is t be printed. PIC Specificatin Printed Output PIC(#########) PI C(ZZZZZZZZZ) PIC(ZZZZZZ###) PIC(******###) PIC($$$$$$###) PIC(++++++###) PIC( - - -######) *** $ c If a flating dllar sign, plus sign, r minus sign is specified nly nce in a PIC specificatin, it des nt flat thrugh the field but instead is printed in the indicated psitin. Fr example: PIC Specificatin PIC($ZZZZZ###) PIC(+ZZZZ###) Printed Output $ Insertin characters Insertin characters insert additinal characters int a field, generally t imprve readability. The fllwing insertin characters can be specified: Character B Meaning Print a blank uncnditinally. Print a cmma cnditinally (nly if a digit precedes the cmma). c / + Print a slash cnditinally (nly if a digit precedes the slash). Print a decimal pint cnditinally (if the value t be printed is nnzer and zer suppressin is nt in effect) Trailing sign. When the + appears in the rightmst psitin f a PIC specificatin, it is treated as a trailing sign. A plus sign is printed fr a psitive number, a minus sign fr a negative. Trailing minus sign. When the - appears in the rightmst psitin, it is treated as a trailing sign. A minus sign is printed fr a negative number, a blank fr a psitive number. BASIC Statements 111

116 The fllwing are examples f insertin characters. Assume a data item value f is t be printed: PIC Specificatin PI C(###B##B####) PIC(ZZZBZZBZ###) PIC(ZZZ,ZZZ,###) PIC(ZZZZZ/Z#/##) PIC(******#.##) PIC($$$$$$###+) PIC($$$,$$$,$$$.##) Printed Output ,233 11/22/33 * $ $112, Expnent Specifier The expnent specifier appears in the fur lw-rder psitins f a data frmat as I I I I. The crrespnding display-print psitins are then: the letter E, the expnent sign (+ r -), and the tw-digit expnent value. Use f an expnent specifier eliminates zer suppressin. Thus, a previusly defined decimal pint will always appear in a field defined by a frmat specificatin cntaining the expnent specifier. Ntes Abut Printing/Displaying with FORM The line number f a FORM statement can be specified in a PRINT USING statement. A FORM statement can appear anywhere in a prgram. Array items are frmatted in rw rder. If values in the PRINT statement exceed frmat specificatins in the FORM statement, the frmat specificatins are reused frm the beginning f the FORM statement until PRINT values are exhausted. If a value in a PRINT statement exceeds the line width f the display r printer, the excess is displayed r printed beginning in the first psitin f the next line. Cntrl specificatins (POS,X, and SKIP) can be intermixed with data frmats (C and PIC). Any data frmat can be preceded by a replicatin factr fr repeated use f the frmat. If SKIP is nt specified after the last data item, the line is nt printed. Any cntrl specificaitns (X, POS, r SKI P) after the last used cnversin specificatin will be prcessed. 112

117 --_..._... ' Example A sample FORM statement is shwn belw: 30 FORM C18,PIC($$####.##) C) When used with this PRINT statement (where B=999.09): 190 PRINT USING 30 FLP, 'BALANCE DUE=',B the resulting utput is: BALANCE DU E= (7 blanks)$ BASIC Statements 113

118 Recrd Frmatting with the FORM Statement When used t frmat recrd data in recrd I/O files, the FORM statement has the fllwing syntax: POS x rj{integer }l LJ arith-var J rfinteger }l Llarith-var J 1,..- ""-, 'char-cn' C DntegerJ ( /' " NC integer [integer] FORM PD integer [integer] integer} *J [{ arith-var S, L PIC ({~pecifier }... 0 I I 0 ) Insert-char (" I \,-.... where: POS indicates the psitin in the recrd that yu want t access (with READ FILE r REREAD FILE statements) r write t (with WRITE FILE r REWRITE FILE statements). This parameter allws yu t select a specific area f the recrd fr input r utput. The value f this parameter can be frm 1 t the length f the recrd. If the value is greater than the recrd length, it will cause an errr. If the value is an arithmetic variable, the truncated integer prtin f the value is used t determine the recrd psitin. X indicates the number f psitins t space frward in the recrd. This parameter allws yu t space ver unwanted prtins f the recrd. If X causes a space beynd the end f the r.ecrd, it will cause an errr. If the value is an arithmetic variable, the truncated integer prtin f the value is used t determine the number f frward spaces. The default value is 1. char-cn are character cnstants (enclsed in single qutatin marks) that will be written exactly as entered when the FORM statement is used. If the character cnstant is used in a FORM statement fr input, it will cause the crrespnding psitns in the recrd t be skipped. Fr example, Xn, where n is the length f the character cnstant. 114

119 C) integer jarith-var* indicates the replicatin factr fr the frmat specificatin that fllws. This value indicates the number f times that the frmat specificatin shuld be reused, which allws yu t use the same specificatin repeatedly. This parameter must be greater than 0 and defaults t 1. If the replicatin factr is an arithmetic variable, the truncated integer prtin is used t determine the number f times the specificaitn shuld be reused. C indicates the field length fr character data. Fr input (with a READ FILE r REREAD FILE statement), the specified number f characters are assigned frm the recrd t the crrespnding character variables listed in the READ FILE r REREAD FILE statement. If the character variable length is less than the number f characters t be assigned, the number f characters specified is assigned and the excess characters are spaced ver. If the variable length is mre than the number f recrd characters t be assigned, the variable is padded n the right with blanks. Fr utput, the specified number f characters are assigned int the recrd frm the data variables listed in the WRITE FILE r REWRITE FILE statement. If the number f characters t be assigned is less than the number yu specify, the characters are padded n the right with blanks t the number yu specified befre being assigned. If the number f characters t be assigned exceeds the number yu specify, nly the specified number f leftmst characters are written int the recrd. The C parameter is valid nly fr character data and will cause an errr if used with numeric data. If a width is nt entered, the number f characters equal t the length f the specified variable is written. NC indicates the cnversin f numeric data, NC integer [.integer]. Fr input, the next number f recrd psitins yu specify (integer) cntain a numeric value that will be cnverted t BASIC internal numeric representatin and assigned t a variable specified in the READ FILE r REREAD FILE statement. In the recrd, the numeric value is a string cnsisting f digits in cmbinatin with any f the characters $, +, -, *, I, b, cmma, decimal pint, r expnential ntatin (E ± numeric cnstant). Zned decimal fields can als be read. The ptinal parameter (.integer) indicates the number f decimal psitins in the field, and will verride an explicit decimal pint in the input field. If this causes the psitin f the decimal pint t change, the value is als changed. C) Fr utput, an arithmetic value frm an expressin in the WRITE FILE r REWRITE FILE statement is cnverted t a signed, zned decimal field f the length specif~ed and placed in the recrd. The value is runded if necessary. The ptinal integer (.integer) indicates the decimal psitins that will be present in the recrd field; therwise, all specified psitins will represent the integer prtin f the arithmetic value. C) BASIC Statements _. _._.. _----_._ _-----_

120 PO indicates the packed decimal frmat fr numeric values, PD integer [.integer]. where: integer is the width f the field in characters and.integer is the number f digits t the right f the decimal pint..integer must be $ 2*;nteger-1. Fr input, the number yu enter (integer) indentifies the psitins in a recrd cntaining a numeric value in packed decimal frm (tw digits per psitin, with ne digit and a sign in the lw-rder psitin). This value will be cnverted int BASIC internal representatin and mved t a crrespnding numeric variable in the READ FILE r REREAD FILE statement. The ptinal specificatin (.integer) identifies the number f decimal psitins in the number. If the.integer specificatin is nt entered, the fractinal number is assumed t be zer. Fr utput, the number yu enter (integer) indicates the recrd psitns int which the crrespnding numeric expressin frm the WRITE FILE r REWRITE FILE statement will be placed. The expressin is first cnverted t packed decimal frmat (runded if necessary) with the ptinal number (.integer) f fractinal digits yu specify. B indicates the length (2, 4, r 8 bytes) f numeric data items in fixed-pint signed binary integer frmat that are t be cnverted t BASIC internal data frmat. Fr recrd I/O file input, the next 2, 4, r 8 bytes in the recrd cntain a signed binary value t be cnverted by the system int internal data frmat and assigned t the variable(s) specified in the READ FILE r REREAD FILE statement using a FORM statement. \'..._.. ' Fr recrd I/O file utput, the value f an expressin in a WRITE FILE r REWRITE FILE statement using a FORM statement is cnverted by the system t fixed-pint signed binary integer frmat, accrding t the length yu specified (2, 4, r 8 bytes), and placed int the recrd. S indicates shrt precisin (4 characters) fr numeric values. Fr input, this entry indicates that a fur-psitin, shrt-precisin value in the recrd is t be assigned t a crrespnding numeric variable specified in the READ FILE r REREAD FILE statement. If prgram executin is using lng precisin, the value is extended n the right with zers befre being assigned t the variable. Fr utput, this entry indicates that a numeric expressin in the WRITE FILE r REWRITE FILE statement will be written in the recrd withut cnversin and in shrt-precisin frmat. L indicates lng-precisin (8 characters) fr numeric values. Fr input, this entry indicates that an eight-psitin, lng-precisin value in the recrd is t be assigned withut cnversin t a crrespnding numeric variable specified in the READ FILE r REREAD FILE statement. If prgram executin is using shrt precisin, the value is truncated n the right befre being assigned t the variable. ",,- -, ( 116

121 ._---_._ _-_.._._----_._... _ _-_._-_.- _._ Fr utput, this entry indicates that a numeric expressin in the WRITE FILE r REWRITE FILE statement will be written in the recrd withut cnversin and in lng-precisin frmat. PIC indicates the frmat fr numeric expressins in utput statements nly. The string f data (up t 32 characters) enclsed in parentheses cnsists f ne f the fllwing characters fr each recrd psitin ccupied by an edited numeric field. These characters can be digit specifiers, insertin characters, and the expnent specifier. Digit Specifiers Digit specifiers can be cnditinal r uncnditinal. They are: Specifier # z Meaning This psitin must always cntain a numeric digit. A leading zer in this psitin is replaced by a blank. c) * $ + CR DB A leading zer in this psitin is replaced by an asterisk. This character is placed in each psitin that can ptentially cntain. a flating dllar sign; that is, a dllar sign t the immediate left f the first significant digit. Nnsignificant zers are suppressed. This character is placed in each psitin that can ptentially cntain a flating high-rder sign. Nnsignificant zers are suppressed. This character is placed in each psitin that can ptentially cntain a flating high-rder minus sign if the value in the recrd is negative. Nnsignificant zers are suppressed. These psitins can be used at the end f the PIC string t indicate a credit amunt. If the value is negative, the characters CR will be printed after it. If the value is psitive, the characters CR are replaced with tw blanks. These psitins can be used at the end f the PIC string t indicate a debit amunt. If the value is negative, the characters DB will be printed after it. If the value is psitive, the characters DB are replaced with tw blanks. BASIC Statements 117

122 Insertin Characters Insertin characters are cnditinal r uncnditinal. They are: Character B Meaning This uncnditinal character always causes a blank t be inserted in the crrespnding psitin f the recrd. This character is inserted in the crrespnding psitin f the recrd unless zer suppressin is in effect and n significant digits appear t the left f the cmma in the recrd. In this case, the cmma will be replaced by a flating r zer suppressin character. This character is inserted in the crrespnding psitin f the recrd unless zer suppressin is in effect and n significant digits appear t the left f the slash in the recrd. In this case, the slash will be replaced by a flating r zer suppressin character. This character is inserted in the crrespnding psitin f the recrd unless zer suppressin has been specified fr every digit psitin and the value is zer. In this case, the decimal pint will be replaced by a flating r zer suppressin character. Trailing + This character causes a plus sign r a minus sign t be inserted in the crrespnding psitin f the recrd unless zer suppressin is in effect and n significant digits appear t the left f the sign in the recrd. In this case, the sign will be replaced by an asterisk r a blank C. '" / 118

123 c) Character Trailing - Trailing $ Meaning This character is inserted in the crrespnding psitin f the recrd if the value t be displayed is negative, unless zer suppressin is in effect and n significant digits appear t the left f the minus sign in the recrd. In this case, the minus sign will be replaced by an asterisk r a blank. This character is inserted in the crrespnding psitin f the recrd unless zer suppressin is in effect and n significant digits appear t the left f the dllar sign in the recrd. In this case, the dllar sign will be replaced by an asterisk r a blank. Expnent Specifier The expnent specifier I I I I causes the fllwing sequence f characters t be placed in the crrespnding psitins f the recrd: (~) 1. The letter E 2. The expnent sign (plus r minus) 3. Tw digits representing the value f the expnent These characters d nt appear in the recrd when zer suppressin is in effect and the value t be placed in the recrd equals zer. BASIC Statements 119 _..._-----_._..._

124 Ntes Abut Recrd Frmatting with the FORM Statement The maximum number f FORM statements permitted in a single BASIC prgram is dependent n the number f image statements als present. Tgether they may nt exceed 50. FORM statements are nnexecutable and may be placed anywhere in a BASIC prgram, either befre r after the I/O statements that refer t them. Hwever, they may nt appear within a multiline functin definitin (between a DEF statement and its assciated FNEND statement)..'... ' A PIC specificatin in a FORM statement may nt cntain bth the Z and the * digit specifiers. A PIC string must be frm 1 t 32 characters lng. A single $, +, r - as the leftmst character in a PIC string is treated as a static character. Tw r mre $, +, r - signs at the leftmst end f a PIC string are treated as flating characters. The same character cannt appear as bth a static character and part f a flating character string in a single PIC string. "' A string f flating characters must cntain at least ne mre flating character than the maximum number f expected digits in the utput field. A PIC string cannt end with a B, slash (f), r cmma (,) insertin character. A PIC string cannt begin with a slash (f) r cmma (,) insertin character. There cannt be mre than ne decimal pint (.) insertin character in a PIC string. A PIC string must include at least ne #, Z, *, r flating string. N # digit specifiers may appear t the left f a zer suppressin character r a flating character. A # digit specifier may nt appear in a PIC string that cntains a decimal pint fllwed by zer suppressin r flating characters. The symbls + and - cannt appear in the same PIC string.. A trailing character may nt appear in a PIC string in which that trailing character is used as either a static character r as part f a flating character string. 120

125 ._ _.. _.-.. _... Examples The fllwing are examples f recrd frmatting with the FORM statement: 25 READ FILE USING 30 'FILEA',KEY=N$, A$, G 30 FORM X25, C, X10, NC7 In the first example, the recrd that satisfies the key value in the variable N$ is read. Tw values frm the recrd are put int the input list variables described in the READ FILE statement. One is a character value placed int A$; the ther is a numeric value placed int G. The FORM statement causes the first 25 psitins f the recrd t be skipped and the number f characters equal in length t the variable A$ (18 by default in this example) t be read int A$. Ten mre psitins are skipped, and the next seven psitins in the recrd are cnverted and read int the numeric variable G. 110 REWRITE FILE USING 100 'FILEA', A$, M 100 FORM X25, C, POS150, PIC(Z##.##) In the secnd example, tw values frm the input list in the REWRITE FILE statement are entered int a recrd in FI LEA. The first 25 psitins in the recrd are skipped, a character value equal in length t the variable A$ is inserted int the recrd, and, in psitin 150 f the recrd, the numeric value in M is inserted accrding t the PIC specificatin. () BASIC Statements 121

126 [MAT] GET file-ref, char-arr-var arith-var arith-arr-var char-var str-func [ ] MAT array-name (rws [,clumns] ) char-arr-var arith-var arith-arr-var char-var str-func [ MAT array-name (rws [,clumns])] [{ [,EXIT line-num] [,EOF line-num] [,CONV line-num] [, IDERR line-numj }] [MAT] GET The GET statement allws yu t assign values frm a specified stream I/O file t referenced variables. The file cntaining the assigned values must already have been pened fr input by an OPEN statement. The frmat f the GET statement is as shwn abve, where: file-ref is frm FLO t FL9 t identify the file cntaining the values t be assigned. This entry must be the same as that specified in an OPEN statement. var is a simple variable, a subscripted array reference, a whle array (preceded by MAT), r a substring reference. Only ne variable is required. If mre than ne is entered, they must be separated by cmmas. If nly arrays are referenced, the keywrd MAT can precede GET. //.---.." 1,\....". EXIT is the line number f an EXIT statement fr errr recvery. EOF, CONV, and IOERR are errr recvery exits (see EXIT statement). When the GET statement is executed, the values frm the specified file (FLO-FL9) are assigned t the referenced variables. Subsequent GET statements fr the same file cause the values in the file t be assigned beginning at the current file psitin. Subscripts in variable references are evaluated as they ccur, frm left t right. Thus, an assigned variable in a GET statement may be used as the subscript f anther variable in the same statement. When a MAT GET statement is executed, r a MAT array name is used in a GET statement, the file values are assigned t the specified arrays rw by rw. The referenced file must have been previusly pened fr input by an OPEN statement. The file is psitined at its beginning fr the first [MAT] GET statement, unless ne r mre GET peratins were already executed. Subsequent [MAT] GET statements fr the same file cause values t be assigned frm the current file psitin. If the ptinal rws, clumns entries fllw the array names in the [MAT] GET statement, the truncated integer prtins f the expressin values are used t redimensin the arrays befre data values are assigned frm the file. 122

127 ._ _-_... _... _-_ _ Ntes Abut [MAT] GET A file currently activated as an utput file cannt be specified in a [MAT] GET statement. It must first be clsed, then repened (in an OPEN statement as an input file). Each value assigned in a [MAT] GET statement must be f the same data type (arithmetic r character) as the crrespnding variable. Referenced arrays can be redimensined (see Redimensining Arrays in Chapter 3). A [MAT] GET statement referencing a currently clsed file causes prgram executin t be terminated. The keywrd MAT must precede referenced. arrays unless all references in the data list are arrays. In this case, use the keywrds MAT GET. Examples A sample GET statement is as shwn: 0090 GET FL4, X, Y, Z, MAT A(4), D$, EOF 620 In this example, the values in file FL4 are assigned, respectively, t variables X, Y, Z, the fur elements f array A, and the character variable D$. On end f file, the prgram branches t statement number 620. The fllwing statements have the same meaning: 0090 GET FL1, MAT A, MAT 8, MAT C 0090 MAT GET FL 1, A, 8, C Nte: Arrays cannt be intermixed with ther variables unless they are preceded by MAT. G 0090 GET FL1, A$, MAT 8, D$ The fllwing example shws a MAT GET statement: 0090 MAT GET FL2; A, 8,(5, 10), Z(4,5), EOF 210 In this example, array A, array 8 (redimensined t 5 rws, 10 clumns) and array Z (redimensined t 4 rws, 5 clumns) will receive values frm file FL2. When end f file is reached, cntrl will transfer t statement 210. c ) BASIC Statements 123

128 GOSUB line-num [[,Iine-num J... ON arith-exp] RETURN GOSUB AND RETURN The GOSUB and RETURN statements are used tgether t create subrutines. The GOSUB statement transfers cntrl cnditinally r uncnditinally t a specified statement. The RETURN statement transfers cntrl t the first executable statement fllwing the last active GOSUB statement that was executed. The syntax f the GOSUB statement is either simple r cmputed. The simple syntax is: GOSUB line-num where: line-num is the number f the statement t which cntrl is t be transferred. The cmputed GOSUB syntax is: GOSUB line [,Iine-num]... ON arith-exp...,.' where: line-num is a statement number. At least ne statement number is required. arith-exp determines the statement t which cntrl is passed. The frmat f the RETURN statement is simply RETURN. Executin f a simple GOSUB statement causes an uncnditinal transfer f cntrl t the statement whse number is specified. Executin f a cmputed GOSUB statement causes the arithmetic expressin t be evaluated and cntrl transferred t the statement whse numeric psitin in the list f statement numbers (reading left t right) is equal t the truncated integer value f the expressin. Thus, an expressin with a value f 2.75 wuld cause cntrl t be tansferred t the secnd statement in the list. If the expressin has a truncated integer value less than 1 r greater than the ttal number f statements listed, cntrl falls thrugh t the first executable statement fllwing the cmputed GOSUB statement. I".. When a GOSUB statement transfers cntrl t a nnexecutable statement, cntrl is transferred t the first executable statement fllwing the specified nnexecutable statement. 124

129 C) If the line number in a GOSUB statement is 999x, the system will call the crrespnding defined functin key grup. If the functin key grup at 999x is undefined, the system transfers cntrl t the indicated line number (999x). The called functin key grup must be defined as a REM key grup. Executin f a RETURN statement causes an uncnditinal transfer f cntrl t the first executable statement fllwing the last active GOSUB statement that was executed. The maximum number f nested subrutines is 20, minus 1 fr each keys functin called (see Functin Keys). C: Example The fllwing examples shw the executin f GOSUB and RETURN statements: 50 GOSUB GOSUB , RETURN 190 GOSUB ~ r 240 RETURN RETU RN -----I The fllwing examples shws a GOSUB t a keys functin: 100 GOSUB 9994_- ~ LOADO,KEY REM 0010 PRINT'IN KEYGROUP 9994' 0020 RETURN 9994 PRINT 'IN MAIN PROGRAM' 9995 RETURN In this example, statement 100 causes the prgram t branch t the REM functin defined fr key 4. If key 4 is nt defined r is defined as smething ther than REM, the prgram seeks statement 9994 within the main prgram. BASIC Statements _----_._..,.",._-----_.._-_.,...",,_._ _._ _..

130 GOTO line-num [[,Iine-num J... ON arith-expj GOTO The GOTO statement transfers cntrl either cnditinally r uncnditinally t a specified statement. The syntax f the GOTO statement can be simple r cmputed. The simple syntax is: GOTO line-num where: line-num is the number f the statement t which cntrl is t be transferred. The cmputed GOTO syntax is: GOTO line-num [,line-num]... ON arith-exp where: line-num is a statement number. required. At least ne statement number is arith-exp determines the statement t which cntrl is passed. Executin f a simple GOTO statement causes an uncnditinal transfer f cntrl t the statement number specified. Executin f a cmputed GOTO statement causes the arithmetic expressin t be evaluated and cntrl transferred t the statement whse numeric psitin in the list f statement numbers (reading left t right) is equal t the truncated integer value f the expressin. Thus, an expressin with a value f 2.75 wuld cause cntrl t be transferred t the secnd statement in the list. If the expressin has a truncated integer value less than 1 r greater than the ttal number f statements listed, cntrl falls thrugh t the first executable statement fllwing the cmputed GOTO statement. When a simple r cmputed GOTO statement transfers cntrl t a nnexecutable statement, cntrl is then passed t the first executable statement fllwing the specified nnexecutable statement. The fllwing statement will uncnditinally pass cntrl t statement number 20: 100 GOTO 20 If X = 4, the fllwing statement will pass cntrl t statement number 60: 50 GOTO 40,60, 15, 100 ON (X+4)/4 (",... / 126

131 ._ _.._----- IF {arith-ex p rel-pr arith-ex p } [{&} {arith-exp rel-pr arith-ex p } ] {THEN} line-num char-exp rel-pr char-exp I char-exp rel-pr char-exp GOTO IF The I F statement allws yu t transfer prgram cntrl accrding t the result f an evaluated expressin. The syntax f the IF statement is as shwn abve, where: arith-exp and char-exp are arithmetic r character expressins. Only ne pair f expressins is required. c re/-pr is a relatinal peratr. Only ne peratr is required. & is the symbl entered fr lgical AND. I is the symbl entered fr lgical OR. THEN and GOTO specify that cntrl shuld be transferred. If yu enter THEN, each time the prgram is listed n the display screen r printer, the system substitutes GOTO fr THEN. line-num is the number f the statement t which cntrl is transferred if the relatinal expressin(s) is true. When an IF statement is executed, the expressins are cmpared as specified by the relatinal peratr. If the relatinship is true, cntrl is transferred t the specified statement number. If the relatinship is nt true, cntrl is passed t the first executable statement fllwing the I F statement. If & is specified, bth relatinal expressins must be true befre cntrl passes t the statement number. If I is specified, cntrl passes t the specified line number if either relatinal expressin is true. If the specified relatinship is true and the specified statement is nnexecutable, cntrl is passed t the first executable statement fllwing the specified nnexecutable statement. Cj Ntes Abut IF The expressins being cmpared within the relatinal expressins must cntain data f the same type (character r arithmetic). THEN and GOTO are interchangeable in the IF statement. Either can be used, but nt bth. GOTO is stred by the system. Cmparisn fr equal must cmpare exactly. BASIC Statements 127

132 . Examples The fllwing examples shw a variety f IF statements: 30 IF A(3)~ X+2/Z GOTO IF R$ = 'CAT GOTO IF 52 = GOTO IF X>Y GOTO 90 \..., 70 IF A>B I C>O GOTO IF A$ = 'JOB' & B$ = 'OATE'GOTO 100 In statement 40, fr example, if character variable R$ cntains the wrd CAT, prgram cntrl is passed t statement 70. In statement 70, if either A>B r C>O, cntrl passes t statement

133 ----_..._-_..._... _ _._....._.. u Ch~r-s.tring }] [{ print-image... print-image [ { Ch~r-s:ring }]... print-image C) IMAGE The image statement is used t cntrl frmatting f printed r displayed data. Fr a cmplete descriptin f the image statement, see [MAT] PRINT USING and Image/FORM. The image statement frmatting specificatins can als be assigned t a character variable, as shwn belw: 90 A$='TOTAL COST IS $###.##' 100 PRINT USING FLP, A$, T1 In this example, variable A$ must have been previusly dimensined t the length f its assigned image specificatins. BASIC Statements 129

134 [MAT] INPUT arith-var arith-arr-var char-var char-arr-var str-func [ MAT array name (rws [,COlumns J ] arith-var arith-arr-var char-var char-arr-var str-func [ ] MAT array name (rws [,clumns]) [.{ ~~~T~i~~~~~~m} ] [MAT] INPUT The INPUT statement allws yu t assign values t variables frm the keybard r prcedure file while yur prgram is being executed. The syntax f the INPUT statement is as shwn abve, where: var are simple arithmetic r character variables, subscripted references t an array element, whle arrays (preceeded by MAT), r substring'references. The rws and clumns references t an array element must be enclsed in parentheses. Only ne variable is required in a [MAT] INPUT statement, althugh many variables can be specified. If nly arrays are referenced, the keywrd MAT can precede INPUT. CONV line-num allws yu t specify a line number t which prgram cntrl will be transferred if yu enter imprper data fr an INPUT statement (such as character data missing a qutatin mark r an ut-f-range numeric). EXIT line-num is the line number f an EXIT statement fr errr recvery (see EXIT statement)., When an INPUT statement is executed, it displays a questin mark n the display screen, and prgram executin halts. Yu must then enter a list f values that will be assigned, in the rder they are entered, t the variables listed in the [MAT] INPUT statement r rw-by-rw t elements f specified arrays. When the cmplete list has been entered, press the EXECUTE key t resume prgram executin. If yu entered the IN=P ptin in the RUN cmmand, values are supplied frm the active prcedure file (see Prcedure File). Each [MAT] INPUT statement will get at least ne recrd frm the prcedure file. If ne recrd des nt supply enugh values fr the data list, additinal recrds will be read. If extra values are present in a recrd, they are ignred. I \ Subscripts f array variables in the INPUT statement are evaluated as they ccur. Thus, an assigned variable in an INPUT statement can be used subsequently as the subscript f anther variable in the same statement. A character cnstant shrter than the defined length f the character variable t which it is assigned is padded n the right with blanks t the defined length befre being assigned. Character cnstants lnger than the defined length are truncated n the right befre being assigned. The maximum length is 255 characters. Character cnstants cntaining n characters (null) are assigned as the defined length f blanks. 130

135 Ntes Abut INPUT Each value entered must be f the same data type (character r arithmetic) as the crrespnding vari~ble reference in the [MAT] INPUT statement. Data types can be mixed in the same statement. Blanks within numeric data items are ignred. Each value entered must be separated frm the next value by a cmma. Tw cnsecutive cmmas are ignred. T end the series, press the EXECUTE key. Character data must be enclsed in single qutatin marks nly if it cntains cmmas, r if leading blanks are significant. The number f values entered at executin time must be equal t the number f variable references specified in the [MAT] INPUT statement. If yu d nt enter enugh values, the prgram will request mre input. If yu enter t many values, the extra entries will be ignred by the prgram. Referenced arrays can be redimensined (see Redimensining Arrays in Chapter 3). The keywrd MAT must precede referenced arrays unless all references in the data list are arrays. In this case, use the keywrds MAT INPUT. Examples A sample INPUT statement is as shwn: 60 INPUT A$, B, X, Y(X), CONV300 'YES', 18.6,8, E-6 When line 60 is executed, yu can enter the list f values shwn. -The prgram will branch t statement 300 if, fr example, yu entered 'YES' fr the first value. The fllwing example shws a MAT INPUT statement: 0100 MAT I N PUT A, A$, B(3,6) C ---' \1 Upn executin f this statement, yu must enter values fr arrays A, A$, and B (redimensined t 3 rws, 6 clumns). BASIC Statements

136 {:;:~~:~;;-var} [, { :;::~:~;;-var } ] ---=arith-exp [LET] { ~~:~~~;;-var } [, {~~:~~~;;-var) ]... = {Char-eX p } str-func str-func char-cn LET The LET statement allws yu t assign the value f an expressin t ne r mre variables. The syntax f. the LET statement is as shwn abve, where: var are scalar variable names, subscripted t references t array elements, r substring references. Only ne varible is required, althugh many can be specified. The rw and clumn references t an array element must be enclsed in parentheses. " exp is an arithmetic r character expressin, a string functin,. r a character cnstant. When the LET statement is executed, the expressin is evaluated, and the resulting value is assigned t the specified variables frm left t right. Character cnstants are limited nly by line length (64 characters). Character expressins can be 1 t 255 characters in length. Character variables can be dimensined t a specific length by using the DIM statement. The initial value f undimensined character variables is set t 18 blank characters. When assigned t a character variable, a character cnstant is adjusted t the length f the variable. Lnger cnstants are truncated, while shrter cnstants are left-justified and padded with blanks n the right. ( ~... -~. ' Ntes Abut LET Data values t the right f the equal sign must be f the same type (arithmetic r character) as the variables t which they are assigned. The keywrd LET is ptinal. Hexadecimal cnstants can als be assigned t character variables in LET statements. The cnstant must begin with X' fllwed by an even number f characters 0 t 9 and A t F. The end f the cnstant must be indicated by a single qutatin mark n. Each pair f characters indicates a character t be assigned. Subscripted references t array elements are permitted in the assignment statement. ( The maximum number f variables t the left f the equal sign in a multiple assignment statement is limited nly by the line size (64 characters). 132

137 (')..../ Examples Sme sample LET statement are as shwn: 10 LET Z$ = 'CAT' 20 LET X = 9 30 LET V(X) = 2 40 V(X),X = X/Y(X) After executin f statement 10, the character variable Z$ will cntain the wrd CAT fllwed by 15 blank characters (if Z$ is 18 characters in length). In statement 20, variable X receives a value f 9. After executin f statement 30, the ninth member f the ne-dimensinal arithmetic array (V) will have the integer value 2. After executin f statement 40, the arithmetic variable X will have the decimal value 4.5. The ninth member f the ne-dimensinal arithmetic array V will have the decimal value 4.5. The actin f statement 40 is t first evaluate the expressin n the right accrding t the current values f the variables Y(X) and X, 2, and 9, respectively. The resulting value, 4.5, is first assigned t V(9), then t the variable X. BASIC Statements 133._._ _.. _-_..... _.. _.._------

138 NEXT cntrl-var NEXT Fr a cmplete descriptin f the NEXT statement, see FOR and NEXT. ('" - --"- 1\.,... ("\ \.... _/ ('"-- -', ( \ ' 134

139 _---_._.-._._._ ONERROR { SYSTEM } GOTO line-num ONERROR The ONERROR statement prvides yu with cmprehensive errr-trapping capability. When an errr is detected during executin, tw internal cnstants in the system (&LlNE and &ERR) will cntain the line number f the statement being interpreted and the number f the errr. This enables yu t recver frm the errr and cntinue frm the pint f interruptin. The syntax f the ONERROR statement is as shwn abve, where: SYSTEM specifies that nrmal errr prcessing be used fr all subsequent errrs. GOTO specifies the line number f the statement t receive prgram cntrl when an errr is detected. Ntes Abut ONERROR I/O statements cntaining errr exit parameters verride the ONERROR statement. ( -', _/ If an errr ccurs after executin f an ON ERROR statement, &LlNE and &ERR are set, but all ther errr indicatrs (internal pinters) are reset. Therefre, the data in &LlNE and &ERR is the nly infrmatin available abut the errr. T prevent repeated entry int yur errr rutine, yu shuld begin yur errr rutine with an ONERROR SYSTEM statement. If the recvery fr a detected errr des nt nrmally recmmend a restart (&ERR>700), certain system infrmatin is lst (such as DEF and GOSUB statement return pints). Cntinued executin after such an errr is nt recmmended. C) If ONERROR is active when cntrl is passed t a key grup (GOSUB 999X), ONERROR is suspended until cntrl returns frm the key grup. ONERROR may be specified in a key grup but is active nly within that key grup and must refer t a statement in that key grup. BASIC Statements 135

140 A sample ON ERROR statement is shwn belw: 010 ONERROR GOTO A=100/0 030 PRINT 'A= 'A 040 STOP 050 ON ERROR SYSTEM 060 PRINT 'ERROR' &ERR 'HAS OCCURRED, at LINE' &LlNE RUN ERROR 681 HAS OCCURRED AT LINE 20 In this example, the ON ERROR statement at statement number 010 causes the prgram t g t statement number 050 if any errrs ccur. The ON ERROR statement causes the 5100 t return t nrmal errr prcessing, then statement 060 causes the errr message, ERROR 681 HAS OCCURRED AT LI N E 020, t be printed. (" "-.. / 136

141 _-_._---_... _._- OPEN file ref {dev-address} file-num}] [{'filename'}] {IN } [{ IOERR line-num}], char-var [ 'arith-var { 'char-var 'OUT 'EXIT line-num IN OUT [RECl= {in~eger }] [ NOBLOCK] [ SEQ], anth-var', All IN KEY [ KW= {in~eger }],, anth-var IOERR line-num}, { EXIT line-num OUT KEY KP= {integer } Kl= {integer },, arith-var' arith-var All,KEY [ KW] = {in~eger }, anth-var OPEN/OPEN FILE The OPEN statement allws yu t: Identify an attached device with a file reference cde. Allcate wrk space fr the file. Specify the file number. Specify the identificatin t be used with the file. Specify the file usage (input, utput, r bth). The syntax f the OPEN statement is as shwn abve, where: file ref is FLO t FL9 t specify the lgical file t be assciated with the physical file identified by the remaining entries in the OPEN statement. This file specificatin can als be referenced in input/utput statements fr stream I/O files. BASIC Statements 137

142 dev-address is the address f the device referenced by the file reference cde. Yu can enter the address directly, r enter a character variable cntaining the device address. Valid addresses are: 'SYS' fr the current system default device address. This address cannt be assigned t a character variable. (see UTIL SYS Cmmand.) 'E80' fr the built-in tape unit (Mdel 1 nly) 'E40' fr the auxiliary tape unit (Mdel 1 nly), 080' fr diskette drive 1, 040' fr diskette drive 2 '020' fr diskette drive 3 '010' fr diskette drive 4 '500' fr the printer '000' fr directing utput t line 1 f the display screen (utput nly) '001' fr allwing GET statements t access data entered frm the keybard (in the same manner that INPUT statements receive data).,/ -... file-num is a cnstant r numeric variable ranging frm 1 t This value is used t access the crrespnding file n the device specified. Decimal values fr variables are truncated t an integer. char-var is a character variable r character cnstant enclsed in single qutatin marks. The first 17 characters prvide the identificatin field in the header recrd f a file being pened fr utput. IN r OUT indicates whether the file is t be used fr input (IN) r utput (OUT). IOERR line-num allws yu t specify the line number f a statement t which prgram cntrl will be transferred if this OPEN statement cannt be cmpleted because f a hardware errr. EXIT line-num allws yu t specify the line number f an EXIT statement t which prgram cntrl will be transferred if this OPEN statement cannt be cmpleted because f an errr cnditin defined in the EXIT statement. A sample OPEN statement is as shwn: OPEN FL1, 'E80',3,IN,IOERR 999 In this example, file reference cde FL 1 will be assigned t reference file 3 n the tape unit built int the 5110 Mdel 1 fr input, and prgram cntrl will transfer t statement 999 in case f a hardware errr. 138

143 The OPEN FI le statement prvides the same capabilities fr recrd I/O files as the OPEN statement des fr stream I/O files. plus the fllwing additinal capabilities: Use f a file fr bth input and utput at the same time Selectin f where utput is t begin Selectin f lgical recrd length Selectin f file access methd The syntax f the OPEN FilE statement is as shwn previusly where: file ref, file-num, 'user ID', char-var, IN, and OUT have the same meaning as described fr the OPEN statement. The remaining parameters have the fllwing meanings: 'dev address' has the same meaning as that fr the OPEN statement with the additinal ptin f addresses '000' and '001', which are invalid, and address '002', which pens the tp 14 lines f the display as a recrd file with a recrd length f 896 characters. RECL = is a nnzer, psitive integer r a numeric variable with a value less than 9999, which indicates lgical recrd length. This entry can nly fllw the OUT parameter t indicate that utput is t start at the beginning f extent (BOE) f the file n diskette. If this parameter is nt entered, utput will be added t the end f the file. NOBLOCK indicates that the file is t be written with nly ne lgical recrd t a physical recrd. This parameter can nly be entered fllwing OUT and RECl=. SEQ indicates that the file can nly be accessed cnsecutively and that recrds can be relcated sequentially fr I/O errr recvery. This parameter can nly be entered fllwing OUT and RECl=. If SEQ is specified, any attempt t access the file randmly with REC= r KEY will cause an errr. ALL indicates that the file can be used fr bth input and utput, including extending and updating f the file. This parameter can nly be entered fr an OPEN FilE statement. IN,KEY identifies the file as a key index file t be used fr input nly. OUT,KEY identifies the file as a key index file t be used fr utput nly. KP = is a nnzer, psitive integer r a numeric variable with a value less than 9999, which identifies the first psitin f the key field in the data recrd. This parameter must be entered fllwing OUT, KEY. BASIC Statements 139

144 KL = is a nnzer, psitive integer r a numeric variable with a value less than r equal t 28, which identifies the length f the key field in a data recrd in a key index file. This parameter must be entered fllwing KP=. KW = is a nnzer, psitive integer r a numeric variable with a value less than 9999, which identifies the amunt f system wrk area that can be used fr key indexed file accessing (see Opening a Key Accessed File). This parameter is ptinal when IN,KEY r ALL, KEY is specified. ALL,KEY indicates that the file is a key index file t be used fr bth input and utput. IOERR line-num and EXIT line-num have the same meaning as described fr the OPEN statement. Ntes Abut OPEN An OPEN r OPEN FILE statement must be issued fr a file befre an input/ utput statement references the file. If a file is already pen, the OPEN [FILE] statement causes an errr message. Once a file is pen, d nt remve the tape cartridge r diskette until the file is clsed. A qute cannt be embedded in a character cnstant used fr a file name. The file name is required fr diskette file utput (see File Reference Parameter in Chapter 3). 140

145 Opening a Key-indexed File When pening a key-indexed file, fllw these general rules: 1. Open the master file using the OPEN FILE statement with the apprpriate parameters. 2. Open the index file with the OPEN FILE statement. Fr the index file, enter the same file reference and access type (such as IN,OUT, r ALL) as entered fr the master file. In additin, enter the KEY parameter and the KW parameter, which indicate key-indexed access and the amunt f strage t be used fr the index file. The key index file is built by the system. The index file cntains nly the key field fr each recrd in the master file, alng with the lcatin f the recrd n tape r diskette. The KW parameter allws yu t allcate space fr a table that is used t imprve access time when IN r ALL is specified and the index file is srted. The size f this space is nrmally a multiple f the sum f the key length plus tw. 3. When accessing recrds in the file with subsequent READ FILE, WRITE FILE, and ther recrd I/O statements, be sure t specify the recrd key. The system lcates the recrd key in the index file, then prceeds t the crrespnding tape/diskette lcatiil fr recrd access. C, Examples 10 OPEN FILE FLI, '080', 'EMPL.MAST, ALL 20 OPEN FILE FLI, '080', 'EMPL.INOX', ALL, KEY, KW=80 The OPEN statements shwn abve enable the prgram t access the file 'EMPL.MAST using the indexed access methd. The files are bth accessed by name nly, and bth files are pened fr update peratins (ALL). (The file 'EMPL.MAST is pened first.) The keywrd KEY in statement 20 indicates that this file is the index file fr 'EMPL.MAST. The KW=80 parameter assigns up t 80 characters in the wrk area fr a table. The table imprves access time when a search is made fr a particular key value. BASIC Statements 141._-_...._...-.._----.._..._...-._._------

146 PAUSE [[J cmment],r-----, PAUSE The PAUSE statement allws yu t interrupt prgram executin t perfrm calculatr peratins. The syntax f the PAUSE statement is as shwn abve, where: cmment is ptinal. If the cmment begins with a single qutaitn mark, it will be displayed n line zer when the PAUSE' is executed. When a PAUSE statement is encuntered during prgram executin, executin is interrupted and the message PAUSE s is shwn n line 0 f the display screen, where s is the line number f the PAUSE statement. T resume prgram peratin, yu must issue a GO cmmand. Nte that yu shuld nt renumber statements (see RENUM in Chapter 2) r alter a calling statement (see DEF, RETURN, FNEND) while a prgram is interrupted. A cmment beginning with a single qutatin mark is displayed after the statement number. The fllwing statement wuld cause the message PAUSE 0080 t be displayed and prcessing t be suspended until a GO cmmand is issued: 80 PAUSE 142

147 [ MAT] PR I NT [file ref] arith-exp, char-exp ~I MAT array-name}] TAB (exp) char-cn MAT array-name} '}] arith-exp [{; char-exp {. TAB (exp) E:har-cn] { '} [{ arith-exp }]. char-exp, TAB (exp) C ' " { [,EXIT line-numj } [,IOERR line-numj [,EOF line-num ] [MAT] PRINT The [MAT] PRINT statement causes the values f specified scalar expressins r arrays t be di,splayed n the display screen, printed by the printer, r written t a file. When using the [MAT] PRINT statement, the frmat f all displayed values is standardized, but the spacing between values n the same line can be cntrlled. The syntax f the [MAT] PRINT statement is as shwn abve, where: file ref is FLP (printer) r FLO t FL9 (lgical file). This entry is ptinal. FLO t FL9 must have been previusly pened in an OPEN statement. exp are arithmetic r character expressins t be displayed r printed. Expressins can be separated by a cmma r semicln. Yu can cntrl spacing f the displayed r printed expressins by inserting cmmas r semiclns between the expressins (see TAB Functin). Expressins can be arithmetic r character (character cnstants must be enclsed in single qutatin marks). With n expressins specified, the PRINT statement can be used t cmplete the displaying r printing f a pending line r insert a blank line. Whle arrays (preceded by MAT) can als be specified. If nly arrays are referenced, the keywrd MAT can precede PRI NT. EXIT, IOERR, and EOF indicate that prgram cntrl be transferred t the specified line number if the crrespnding errr shuld ccur (see EXIT statement). When a PRI NT statement is executed, the value f each specified expressin is cnverted t the apprpriate utput frmat as described under Print Znes, and displayed r printed in a left-t-right sequence in the rder in which it appears in the PRINT statement. When a MAT PRINT statement is executed, each array element is cnverted t - a specified utput frmat and displayed. BASIC Statements _._ , '..._..._-----_.._.._-----

148 Each array is displayed by rws; the first rw f each array begins at the start f a new line and is separated frm the preceding line by tw blank lines. The remaining rws f each array begin at the start f a new line and are separated frm the preceding line by ne blank line. After each array element is displayed r printed, the starting psitin f the next element is determined by the delimiting character, as described under Spacing f Displayed Values. Print Znes In general, each PRINT statement causes a new display r print line t be started, and each line is divided int print znes-either full print znes r packed print znes, r cmbinatins f bth. \... ' Full Print Znes have 18 character psitins and are specified by the cmma delimiter. Fr example, the statement 200 PRINT A,B,C wuld cause the value f variable A t be displayed beginning in the first psitin f the line, the value f B beginning in psitin 19, and the value f C beginning in psitin 37. Packed Print Znes are variable in length and usually prduce a mre dense line f utput than full print znes. The semicln and null delimiters are used t specify packed print znes. The length f packed print znes fr varius types f data is explained under Spacing f Printed r Displayed Values. Spacing f Printed r Displayed Values The cnverted value f each expressin r array element is printed r displayed in its wn print zne. A print zne can be either full (18 psitins) r packed (variable lengths) as specified by the delimiter fllwing the array reference r expressin. Full Print Znes (Cmma Delimiter): Fr arithmetic expressins, the cnverted data items require ne full print zne f 18 character psitins. Fr character data, the print r display area is the smallest number f full print znes (smallest multiple f 18) large enugh t accmdate.the data. /" I \,.. _... Since mst printed r displayed values are shrter than 18 characters, a line f full print znes usually prduces clumns f widely spaced utput. l '... -.,.". c 144

149 Packed Print Znes (Null [PRINT nly] r Semicln Delimiter): Fr arithmetic expressins r numeric arrays, the length f the packed zne is determined by the length f the cnverted value, including the sign, digits, decimal pint, and the expnent, as shwn in Figure 9. Fr character cnstants, the length f the packed print zne is equal t the length f the characters enclsed in single qutatin marks, including blanks, but excluding the single qutatin marks preceding an apstrphe. Fr character variables, the length f the packed print zne is equal t the length f the character string, minus any trailing blanks. Packed print znes usually prduce a denser line f utput than full print znes. Length f Cnverted Length f Packed Example (0 Data Item Print Zne represents a (characters) (characters) (blank) DO E-23DDO DOO E-22 The number f digits displayed r printed is cntrlled by the current value assigned t RD= (see RD= Cmmand in Chapter 2). Figure 9. Packed Print Zne Lengths fr Arithmetic Expressins and Array Elements Standard Output Frmats fr Printing r Displaying (:) Character Cnstants The actual characters enclsed in single qutatin marks (including trailing blanks but excluding the single qutatin marks preceding an apstrphe) are printed r displayed. C) BASIC Statements 145,.',.. '.,."--, ,-_._.,-,.",',._

150 Character Variables The actual characters (excluding trailing blanks) are printed r displayed. / Arithmetic Expressins I-Frmat: The integer, cnsisting f a sign (blank r minus) and up t 15 significant decimal digits fr integers whse abslute value is less than 1 E+14, is printed r displayed. E-Frmat: The flating-pint number, cnsisting f a sign (blank r minus), up t 15 significant decimal digits, a decimal pint fllwing the first digit, the letter E, and a signed expnent cnsisting f ne r tw digits is printed r displayed. The E-frmat is used t print r display numbers whse abslute value is less than 1 E-2 r greater than r equal t 1 E+14. Printed r displayed values are runded ff, nt truncated. F-Frmat: The fixed-pint number, cnsisting f a sign (blank r minus) up t 15 significant digits, and a decimal pint in the apprpriate psitin is printed r displayed. The E-frmat is used t print r display values nt included in the preceding 1- r E-frmat descriptins.,-.' Display Line Operatin As the values f expressins r array elements are transferred t the display screen, an internal line psitin pinter is maintained t keep track f the next available psitin where a character (r digit) can be placed. The mv~ment f this line-psitin pinter befre, during, and after displaying an expressin depends n the type f expressin and the delimiter fllwing it in the [MAT] PRI NT statement. Figure 10 shws the pinter actins that are pssible. The psitin f the display line-psitin pinter can be mved frward (t a higher-numbered character psitin) by the TAB functin. If an array delimiter is a cmma, the line-psitin pinter is mved past any remaining psitins in the full print zne after the system transfers the element value t the display screen. If the final delimiter is a semiclr, the line-psitin pinter is mved past any remaining psitins inthe packed print zne after the system transfers the element values t the display screen. See Print Line Buffer Operatin. 146

151 Type G Data Pinter Psitin Befre Pinter Psitin After Delimiter Displaying r Printing Displaying r Printing Arithmetic Cmma If the recrd cntains suf- The pinter is mved Expressin ficient space fr the expres- past any remaining sin, data will be written psitins f the full beginning at the current print zne. If the end psitin f the pinter. f the recrd is reached, If there is nt sufficient the recrd is printed r space, the cntents f displayed and the pinter the first recrd are wr.it- is set t the start f the ten and the expressin next recrd. will start at the beginning f the next recrd. Semicln Null (nt end f statement) The pinter is mved past any remaining psitins f the packed print zne. If the end f the recrd is reached, the recrd is printed r displayed and the pinter is set t the start f the next recrd. Null (end f statement) The recrd is printed r displayed and the pinter is set t the start f the next recrd. Figure 10 (Part 1 f 3). Psitins f Display r Print Line Psitin Pinter COO, I C -_ '''! ) BAS I C Statements 147 " _._ ,.---

152 Data Pinter Psitin Befre Pinter Psitin After Type Delimiter Displaying r Printing Displaying r Printing / Character Cmma If at least 18 character The pinter is mved Variable psitins remain in the past any remaining recrd, data will be writ- characters f the full ten beginning at the cur- print zne. If the end rent psitin f the f the recrd is reached, pinter. If less than 18 the recrd is printed psitins remain, the r displayed and the recrd is printed r dis- pinter is set t the played and the cnstant start f the next recrd. will be written starting at the beginning f the next recrd. If the end f the recrd is encuntered befre the characters are written, the recrd is printed r displayed and the remaining characters will be written starting at the beginning f the next recrd. \... Semicln The variable is written The pinter is left at the starting at the current psi- psitin immediately tin f the pinter. If the fllwing the last end f the first recrd is character. reached befre all data is written, the recrd is displayed r printed and the remaining data will start at the beginning f the next recrd. Null (nt end f statement) Null (end f statement) The recrd is written and the pinter is set t the start f the next recrd. \. Figure 10 (Part 2 f 3). Psitins f Display r Print Line-Psitin Pinter \

153 ------_...-.._ _------_._------_......_-_.._ Data Pinter Psitin Befre Pinter Psitin After Type Delimiter Displaying r Printing Displaying r Printing Null Cmma N data is displayed. The pinter is mved frward 18 character psitins. If the end f the recrd is reached, the recrd is printed r displayed and the pinter is set t the start f the next recrd. Semicln Null (nt end f statement) The pinter is mved frward 3 character psitins. I f the end f the recrd is reached, the recrd is printed r displayed and the pinter is set t the start f the next recrd. Null (end f statement) (, ~) C) remaining Character Cmma N data is displayed. The pinter is mved past Cnstant any remaining spaces in the Semicln full print zne. If the end f the recrd isreached,the recrd is printed r displayed and the pinter is set t the start f the next recrd. Null (nt end The variable is written The pinter is left at the f statement) starting at the current psitin immediately psitin f the pinter. fl.lwing the last character. If the end f the first Null (end recrd is reached befre The recrd is written and f statement) all data is written, the the pinter is set t the recrd is displayed r start f the next recrd. printed and the data will start at the beginning f the next recrd. Figure 10 (Part 3 f 3). Psitins f Display r Print Line-Psitin Pinter C) BASIC Statements 149

154 TAB Functin The TAB (expressin) functin allws yu t align clumns f data. When (expressin) is a nn-integer, it is truncated. Thus, TAB(n) starts the next utput in clumn n f the line. If the current psitin in the line is greater than n, data is put n the next line in psitin n. TAB(n) can be fllwed by a cmma r semicln with the same result. If n is greater than the line length, data is put at psitin X after cmputatin f the fllwing, where n = the TAB expressin and L = line length: X =n-l*int((n-1 /L) Fr example, if line length = 64 and the TAB(n) = 70, the integer value ((70-1) /64) = 1 is multiplied by 64 and is subtracted frm n, which is 70-64=6. Thus, utput begins in psitin 6 f the next line. This frmula nly applies where L = 1 t Print Line Buffer Operatin The print line buffer is a temprary strage lcatin where the characters fr each print line are placed. After all data fr a print line has been placed in the buffer, the data line is printed. A buffer-psitin pinter is used t keep track f the next available psitin where a character (r digit) can be placed in the buffer. The mvement f the buffer-psitin pinter befre, during, and after mving an expressin int the buffer depends n the type f expressin t be printed and the delimiter fllwing it in the PRINT statement. The psitin f the buffer-psitin pinter can be mved frward by the TAB functin. See the PRINT statement examples that fllw. The fllwing examples shw hw varius arithmetic values wuld be printed r displayed. The symbl 0 represents a blank character, which always appears in the sign psitin f a psitive number. Value Given Value Printed (' \ " 150

155 C) Ntes Abut [MAT] PRINT If there is n printer attached t the system, executing the PR I NT F LP statement stps the prgram unless the P = D (printer = display) ptin was specified in the RUN cmmand. Null delimiters are nt permitted in a MAT PRINT statement except as the final delimiter. C ' "I ) Examples The fllwing examples shw the utput resulting frm several PRINT statements: Statement Output 10 PRINT FLP,'A','B' 20 PRINT 'A';'B' A-17 blanks-b AB 30 LET A$ = 'B' 40 PRINT FLP,' A' A$ 50 PRINT FLP,A$'A',A$;A$ 60 PRINT A$;'A' AB BA-17 blanks-bb BA 70 LET A$=', 80 PRINT FLP,'A';A$;'A' 90 PRINT 'A';' ';'A' 100 PRINT FLP 110 PRINT 'NAME' TAB (30) 'ADDRESS' AA AnA Blank line NAME-25 blanks-address 120 END BASIC Statements _... _._.._-_..._ _

156 The fllwing example shws the executin f a MAT PRINT statement: 10 DIM A(3,4), A$(12), C(2,2) 20 MAT READ A,A$ 30 DATA 1,2,3,4,5,6,7,8,9,10,11,12, 40 DATA 'A','8','C','D','E','F,'G','H','I','J','K','L' 50 MAT C = (1) 60 MAT PRINT A 70 MAT PRINT A$; 80 MAT PRINT C Displayed utput will be: :I. "'j ~:....., \:, '+ I::' ' J 6 '7 :I. 0 :I. :1. :1. ~.:.~ (:',BC:OEF[iH I....11< I... :I. :1. :1. :I. r... ' C~ 152

157 .,...,...,.._----,..._... "....._----- (; [MAT] PRINT USING 'file refj {Iine-num} L.', char-var [ MAT array-name} [{' { M~ T arr. ay-name }] ],, ch.ar-ex p ;} anth-exp... [{;}] { anth-exp char-exp c) [I [' EXIT line-num] )J [,IOERR line-numj [,EOF line-num] [,CONV line-numj ( '/ Ch~r-S~ring }] [{ pnnt-image... print image ch.ar-s~ring}] '" [ { prlnt'lmage [MAT] PRINT USING AND IMAGE/FORM (~) The [MAT] PRINT USING statement and its assciated image r frm allw yu t display specified scalar values r array elements in a frmat f yur wn chsing. The [MAT] PRINT USING statement specifies the values t be displayed and the image r FORM t be used. These statements specify the frmat f the line t be displayed. The syntax f the PRINT USING and image statements is as shwn abve, where: file ref is an ptinal specificatin f FLO t FL9 t identify the lgical file int which the frmatted data is t be placed r FLP t specify printing. If nt specified therwise, the frmatted data is displayed. FLO t FL9 must have been previusly referenced in an OPEN statement. line-num is the stat~ment number f the image statement r FORM statement that defines hw data is t be frmatted when printed r displayed. C) char-var is a character variable cntaining frmat infrmatin identical t that in an image r FORM. statement. Fr an image statement, the cntents f the character variable can be the same as the cntents fllwing the cln in a standard image statement. Fr a FORM statement, the first fur psitins in the character variable must be the characters FORM, fllwed by nrmal frmat specificatins f a standard FORM statement. exp is an arithmetic r character value separated by semiclns r cmmas. These values are incrprated (edited) int the frmat f the image r FORM statement specified. A cmma r semicln can als fllw the last expressin. Whle arrays (preceded by MAT) can als be specified. If nly arrays are referenced, the keywrd MAT can precede PRINT USING. print-image is the frmat specificatin (see Frmat Specificatins). BASIC Statements 153

158 When a [MAT] PRINT USING statement is executed, the specified expressins r array references are evaluated, and their values are edited in rder f appearance in the [MAT] PRINT USING statement int the crrespnding frmat specificatins in the specified image r frm. A string f character cnstants will be printed exactly as entered in the image statement described in the fllwing text. Array elements are displayed by rw.. Fr a descriptin f FORM statement frmat, see FORM statement. Cnversin f Data Reference Values with Image When the data referred t is a character value, the characters cntained in it are edited int the line, replacing characters in the frmat specificatin including sign (+,-), pund sign, decimal pint, and I I II. If an edited character value is shrter than its frmat specificatin, blank padding ccurs n the right. If an edited character value is lnger than its frmat specificatin, it is truncated n the right. A character cnstant cntaining n characters (null) causes blank padding n the entire frmat specificatin. An arithmetic expressin is cnverted accrding t its frmat specificatin as fllws: If the frmat specificatin cntains a plus sign and the expressin value is psitive, a plus sign is edited int the line. If the frmat specificatin cntains a plus sign and the expressin value is negative, a minus sign is edited int the line. If the frmat specificatin cntains a minus sign and the expressin value is psitive, a blank is edited int the line. If the frmat specificatin cntains a minus sign and the expressin value is negative, a minus sign is edited int the line. If the frmat specificatin des nt cntain a sign and the expressin value is negtive, a minus sign and the negative number will be printed, prvided that the frmat specificatin is lng enugh t cntain bth the number and the sign. If the frmat specificatin is nt lng enugh, asterisks are edited int the line instead f the negative number. Asterisks are als edited int the line fr psitive values that are t large. The expressin value is cnverted accrding t the type f its frmat specificatin as fllws: I-Frmat: The value f the expressin is cnverted t an integer, runding any fractin. F-Frmat: The value f the expressin is cnverted t a fixed-pint number, either runding the value r extending it with zers accrding t the frmat specificaitn. E-Frmat: The value f the expressin is cnverted t a flating-pint number, runding the value r extending it with zers and adjusting the expnent accrding t the frmat specificatin. 154

159 ---_.._..._-_..._ _.._._......_----- C) ( _.. J Fr I r F frmat, the length f the integer prtin f the arithmetic expressin value is less than r equal t the length f the integer prtin f the frmat specificatin, the expressin value is edited, right-justified, and padded with blanks int the line. If the length f the integer prtin f the frmat specificatin is less than the length f the integer prtin f the expressin value, asterisks are edited int the line instead f the expressin value. Frmat Specificatins Fr each ccurrence f the pund sign (#) in an image statement r character variable, a single space is reserved in the display r print line fr a character in the crrespnding expressin f the assciated PRINT USING r MAT PRINT USING statement. The pund sign represents either character r arithmetic data. Fr arithmetic data, decimal pints and the plus and minus signs, like the characters in the general frmat descriptin, are printed as entered, prvided the values are apprpriate t the specified signs. (See Cnversin f Data Reference Values fr a discussin f the displaying / printing f signs in the image statement.) Fr character data, the character string will verride any frmat descriptrs. The varius frmat specificatins are: Character- Frmat-One r mre # characters, as shwn: #### (~) I-Frmat (integer frrnat)-an ptinal sign fllwed by ne r mre # characters, as shwn: [+-] # [#]... F-Frmat (fixed-decimal frmat)-an ptinal sign fllwed by either: 1. N # characters, a decimal pint, and ne r mre # characters, as shwn:.#[###] c) 2. One r mre # characters, a decimal pint fllwed by n # characters, as shwn: #[###]. 3. One r mre # characters, a decimal pint, and ne r mre # characters, as shwn: [+-] [#]... #[#]... [#]... E-Frmat (expnential frmat)-either the 1- r F-frmat (described previusly) fllwed by fur I characters (I I I I). BASIC Statements 155

160 The fllwing rules define the start f a frmat specificatin: 1. A #, character is encuntered and the preceding character is nt a # character, decimal pint, plus sign, r minus sign. 2, A plus r minus sign is encuntered, fllwed by: a. A # character, r b. A decimal pint that precedes a # character. 3.. A decimal pint is encuntered, fllwed by a # character and: a. The preceding character is nt a # character, plus sign, r minus sign, r b. The preceding character string isan F-frmat specificatin. The fllwing rules define the end f a frmat specificatin that has been started: 1. A # character is encuntered and: a. The fllwing character is nt a # character, r b. The fllwing character is nt a decimal pint, r c. The fllwing character is a decimal pint and a decimal pint has already been encuntered, r d. The fllwing fur cnsecutive characters are nt I characters (I I I I). 2. A decimal pint is encuntered and: a. The fllwing character is nt a # character, r b. The fllwing character is anther decimal pint, r c. The fllwing fur characters are nt I characters (I I I I). /"'~-""""., I \._.., 156

161 ._ _._--._... _ C) Sme examples f expressins and the way they are displayed r printed under varius frmat specificatins are as fllws: Frmat Expressin Displayed r Specificatin Value Printed Frmat ##### 'APPLES' APPLE #### ### ### 12 1)12 ### )1)1 ##.## 123 ***** ##.## )1.23 ##.## )1.23 ##.## )1).12 ##.## ### E+OO ### E-01 ### E-03 ##.## E+01 ##.## E-01 ##.## E-02 ##.## E+02 C) During utput, specified expressins are displayed r printed beginning where the previus PRINT r PRINT USING statement ended in a line. If this is the first PRINT r PRINT USING statement, utput begins n a new line. If the PRINT USING statement cntains expressins r array elements that exceed frmat specificatins in the specified image statement, utput is cntrlled by the delimiter fllwing the expressins. If the delimiter is a cmma, the current line is displayed r printed, and the remaining expressins are frmatted accrding t the beginning f the image statement, and utput begins n a new line. If the delimiter is a semicln, expressins remaining after the end f the image statement are frmatted accrding t the beginning f the image statement, and utput cntinues n the same line. BASIC Statements 157

162 When the image statement is being used, the delimiter fllwing the last expressin value cntrls printing at the end f expressins. If the delimiter is a cmma r blank, the current line is displayed r printed and the next utput will start n a new line. If the delimiter is a semicln, the current line is nt displayed r printed and the next utput will be added t the current line. When a FORM statement is used, (see FORM), the current line is nt displayed r printed unless a SKI P specificatin fllws' the last data frmat specificatin used. If the end f the image r FORM statement is reached after the last expressin value r the first unused frmat specificatin is fund, frmatting is stpped. Ntes Abut PRINT USING The number f image r FORM statements permitted in a BASIC prgram is nly limited by available strage. If the [MAT] PRINT USING statement utput list cntains at least ne item, there must be at least ne frmat specificatin in the crrespnding image statement. If there is n printer attached t the system, executing the [MAT] PRINT USING FLP statement stps the prgram, unless the P = D (printer = display) ptin was specified in the RUN cmmand. Image and FORM statements are nnexecutable and can be placed anywhere in a BASIC prgram, either befre r after the PRINT USING statements that refer t them. If the number f elements in an array rw exceeds the number f cnversin specificatins in the assciated image statement, the image statement is reused fr the remaining elements f that rw, and if the delimiter fllwing the array is a cmma, a new line is started. The line fr each rw is terminated at the first unused cnversin specificatin after the last element in the rw is printed r displayed. 158

163 Examples The fllwing example shws executin f a PRINT USING statement where: A = 342 and B = :RATE OF LOSS####EQUALS####.##POUNDS 110 PRINT USING 100,A,B The utput is: RATE OF LOSS 342 EQUALS POUNDS The same utput wuld result frm: 100 A$='RATE OF LOSS #### EQUALS ####.## POUNDS' 110 PRINT USING A$,A,B Nte that A$ must have been previusly dimensined t the apprpriate length: 90 DIM A$39 The fllwing example shws executin f a MAT PRINT USING statement: 0010 DIM A(4,3) 0020 :### ##.## ##.## IIII 0030 MAT A=(1) 0040 MAT PRINT USING FLP,0020,A The utput wuld appear as: :I. :I. I 00 :1.0 I (10[ 0 :I. C ')./ l :I. 00 :I. 0 00[ 0:1. :I. :I. I I 00[ 0:1. 1 :l I I 00E 01 C) BASIC Statements _._-_... -_._.. _-_... _._ _------_. _.... _---_._... _-_._.. _------

164 [MAT] PUT file ref, {~~i~~_::: } [, { ~~~~.. ::: 1] [{ MAT array-name [, EXIT line-numj 1] MAT array-name [, EOF line-num] [, IOER R line-numj \~." ''-... ~' [MAT] PUT The [MAT] PUT statement allws yu t write the values f specified variables r array elements int a particular stream I/O file. The file must have already been pened with an OPEN statement. The syntax f the [MAT] PUT statement is as shwn abve, where: file ref is FLO t FL9 t identify the file int which variable values will be written. exp are functin references, subscripted array references r whle arrays (preceded by MAT) representing the values t be written. Only ne value is required. If mre than ne is specified, the values must be separated by cmmas. If nly arrays are referenced, the keywrd MAT can precede PUT. EOF, IOERR, and EXIT are errr recvery exits (see EXIT statement). When a [MAT] PUT statement is executed, the specified scalar reference r array element value is entered frm left t right int a buffer fr the specified file, beginning at the current file psitin. The file is written sequentially s that the first value entered by the [MAT] PUT statement will be the first value assigned frm the file when the file is referenced in a [MAT] GET statement. When the buffer becmes full, the cntents are written ut. Tape buffers are 512 bytes in length. Diskette buffers are 128, 256, 512, r 1,024 bytes in length depending n diskette frmat. As many bytes as pssible are used in each buffer. Character data is written with enclsing qutatin marks. Cmma separatrs are written between data items. A new line character (hexadecimal 15) replaces the cmma at the end f an array rw r is written at the end f the data items listed in the [MAT] PUT statement. A file can be activated nly by an OPEN statement and is deactivated by a CLOSE statement r at the end f prgram executin. /~ ( '-" ~ \..._.... ;' 160

165 C) Ntes Abut [MAT] PUT A file currently activated as an input file cannt be specified in a [MAT] PUT statement. It must be clsed, then repened fr utput, r a RESET EN D statement must be issued. If space in the utput file is exhausted befre all values in the utput list are placed in the file, prgram executin is terminated. A [MAT] PUT statement referring t a currently clsed file causes a prgram errr. A stream I/O file accessed with a [MAT] PUT statement must have been pened with an OPEN statement. Numeric values are written as numeric cnstants with nly insignificant zers drpped. All ther digits are kept regardless f the RD=value. Examples A sample PUT statement is as shwn: 20 PUT FL1, Z3, 5*X-7,A,D$,9.005 lj In this example, the specified values will be written int file FL 1. The fllwing example shws a MAT PUT statement: 0100 MAT PUT FL4, 8, C$ In this example, the values f the elements in array 8 and array C$ are put int file FL4. BASIC Statements _ _...._-_.._---_. _.._..._._..._.._----_..._..._..._---._---

166 [MAT] READ arith-var arith-arr-var char-var char-arr-var str-func MAT array-name [(rws [,clumns] ~ arith-var arith-arr-var, char-var char-arr-var str-func [MAT] READ The [MAT] READ statement allws yu t assign values t variables, array elements, r entire arrays frm the internal data table created by DATA statements. The syntax f the [ MAT] READ statement is as shwn abve, where: "'" var are simple arithmetic r character variables, substrings, subscripted references t a single array element r whle arrays (preceded by MAT). Only ne variable is required. If nly arrays are referenced, the keywrd MAT can precede READ. At the beginning f prgram executin, a pinter is set t the first value in the data table. When a READ r MAT READ statement is encuntered, successive values frm the data table are assigned t the variables r array elements in a READ statement, r t entire arrays in the MAT READ statement. The values are assigned t the array by rws, beginning at the current psitin f the data table pinter. The data table pinter can be reset by use f the RESTORE statement. ( I If a redimensin specificatin fllws the array name, the truncated integer prtin f each value in rws and clumns is used t redimensin the array befre values are assigned t it. Subscripts f array variables in the [MAT] READ statement are evaluated as they ccur; thus, an assigned variable in a [MAT] READ statement can be used subsequently as the subscript f anther variable in the same statement. (.. " 162

167 c) c Ntes Abut [MAT] READ 8efre being used in a [MAT] READ statement, arrays must have been defined, either implicitly, r expli'citly in a USE r DIM statement. If the data table is exhausted and unassigned variables, arrays r array elements remain in the [MAT] READ statement, an errr ccurs. If there are n DATA statements in the prgram, the [MAT] READ statement will cause an errr. The [MAT] READ statement cannt be used in a prgram assigned t ne f the functin keys. This will cause an errr when the functin is executed. If redimensin specificatins are entered, the rules under Redimensining Arrays in Chapter 3 must be fllwed. Each value read frm the data table must be f the same type (character r arithmetic) as the variable t which it is assigned. Examples The fllwing shws the executin f READ statements: 10 DATA'JONES', 15.00, 'SMITH', READ A$,A1,8$,81 30 DATA 1,2,3,4,5,6 40 READ A,8,C,X(A)'X(8),X(C) After executin f these statements, the character variables A$ and 8$ will cntain the character strings JONES and SMITH, respectively, each padded n the right with blanks t a length f 18. The arithmetic variables A 1 and 81 will cntain the decimal values and 20.50, respectively. The arithmetic variables A, S, and C will cntain the integer values 1, 2, and 3, respectively, and the first three elements f the ne-dimensinal array X will cntain the integer values 4, 5, and 6, respectively. The fllwing example shws a MAT READ statement: 0100 MAT READ A$ (2), A, 8(12) In this example, array A$ is redimensined t tw elements, array 8 is redimensined t 12 rws, and then values frm the data table are assigned t arrays A$, A, and 8. BASIC Statements _._--_... _... ".. _-

168 KEY rei-peratr Char-var}] line-num. READ FI LE [USING { h.. } ~ file-ref,.. ' {., c ar-var ' REC= mteger} [ { arith-var arith-var arith-arr-var char-var char-arr-var str-func [ MAT array name (rws [,cois] J [,EXIT line-num] [{ [,EOF line-num] [,IOERR line-num] [.,I [ {NO KEY line-num}] }],CONV Ime-num..J ' NOREC line-num [MAT] READ FILE The [MAT] READ FILE statement allws yu t assign values frm a recrd in a file (recrd I/O) t specified variables r arrays. By entering the ptinal USING parameter, yu can als specify a FORM statement that permits cnversin f data frm the frmat defined in the FORM statement. Nte that each value t be assigned must be f the same type as the variable t which it is assigned (numeric r character). The syntax f the READ FILE statement is as shwn abve, where: USING line-num/char-var indicates that data t be assigned will be in the frmat defined in the FORM statement at the line number specified r assigned t the character variable specified. If this parameter is nt entered, the system assumes that numeric data is in internal frmat, and that precisin is identical t that currently in peratin. file-ref is FLO t FL9 t identify the file frm which variable values will be assigned, r FLS (see File FLS). KEY rei-peratr char-var allws yu t specify the key field used t access the recrd in the file. KEY indicates key indexed access f the file, rei-peratr indicates equal (=) r greater than r equal (~), and char-var cntains the actual recrd key t be cmpared t thse f recrds in the file until the matching recrd is fund. The character variable can be less than r equal t the length f the actual key field. If the character variable is shrter than the key field, the search f the index will cnsider nly that part f the key field equal t the length f the specified search argument. If this parameter is nt entered, the next sequential recrd in the file is accessed. Fr a key indexed file, the recrd with the next sequential key is accessed....,. (----' '-'''''' " 164

169 REC = can be a psitive, nnzer integer r numeric variable indicating the lgical recrd number f the recrd t be accessed. If this parameter is nt entered, the next (r first) lgical recrd will be accessed. var are simple arithmetic r character variables, substrings, subscripted references t a single array element r whle arrays (preceded by MAT) t which values are t be assigned. Only ne variable is required. If nly arrays are referenced, the keywrd MAT can precede READ FILE. C) EXIT, EOF, IOERR, NOKEY, CONV, and NOREC indicate that prgram cntrl shuld be transferred t the apprpriate statement number if the indicated errr cnditin ccurs. See EXIT statement in this chapter. Ntes Abut [MATl READ FILE The REC parameter cannt be used t access a key indexed file. The KEY parameter can be specified nly if a key indexed file has already been pened (using OPEN FILE). If redimensin specificatins are entered, the rules under Redimensining Arrays in Chapter 3 must be fllwed. The keywrd MAT must precede referenced arrays unless all references in the data list are arrays. In this case, use the keywrds MAT READ FILE. 1",---,. / J \.--"" EOF, IOERR, NOKEY, CONV, and NOREC errr recvery exits can be entered in any sequence. Each value t be assigned frm the recrd must be f the same type as the variable t which it is assigned (character r numeric). The length f the KEY parameter must be less than r equal t the actual recrd key field. If OUT was specified in the OPEN FILE statement fr the referenced file, a prgram errr will ccur. C) A READ FI LE issued t a type 2 file cntaining hex 1 E r hex 15 causes unpredictable results. These characters are recrd delimiters. A READ FILE t device '002' will pen the keybard fr input. Data entered n the keybard is displayed n the tp 14 lines f the screen. A sample READ FILE statement is shwn belw: 20 I$='INVENTORY' 30 READ FILE FL8, KEY=I$,A$,D$,F$,R$,NOKEY 999 In this example, the recrd in file FL8 with a key field matching INVENTORY will be accessed. Next, values fr A$,D$,F$,R$ will be assigned frm the recrd. If n recrd in the file has a key f 'INVENTORY', prgram cntrl will transfer t statement 999. BASIC Statements 165

170 rmat] REREAD FILE [USING {Iine-num} J file-ref ~ char-var', arith-var arith-arr-var char-var char-arr-var str-func MAT array-name [(rws [,clumns] ) J [ { CONV line-num}], EXIT line-num [MAT] REREAD FILE The[ MAT] REREAD FILE statement allws yu t access the last recrd that was read. After the recrd is accessed, the executin f a [MAT] REREAD FILE statement is identical t executin f a [MAT] READ FILE statement. The last access t the file being referenced must have been with a [MAT] READ FILE r anther [MAT] REREAD FILE statement. The CONV and EXIT errr recvery exits are the same as thse described fr the [MAT] READ FI LE statement. Nte: A REREAD FILE statement referencing device '002' will reread whatever is n the tp 14 lines f the screen withut pening the keybard fr input. A sample REREAD FILE statement is shwn belw: 010 MAT REREAD FILE USING 100, FL1,A,A$ /...---,, In this example, the FORM statement at 100 is used t reread the file referenced by FL 1, and the data in the recrd is assigned t array A and A$. r" \ '.. _/ 166

171 ---_._._---_.-... _ _._......_--_._-._..-._- C) REM REM [cmmen~ The REM (remark) statement allws yu t insert remarks r cmments in a BASIC prgram listing. The syntax f the REM statement is as shwn abve, where: cmment is ne r mre characters. This is an ptinal entry. The REM statement is nnexecutable. It appears in prgram listing, but has n effect n prgram executin. Ntes Abut REM A REM statement can be used anywhere in a BASIC prgram. Als see Functin Keys in Chapter 2. Example A sample REM statement is as shwn: 10 REM THIS PROGRAM DETERMINES THE COST PER UNIT c c BASIC Statements 167

172 END END RESET [FI LE ] file-ref REC= {in~eger } anth-var, file-ref REC= {in~eger } anth-var KEY=r> char-var KEY= r> char-var [,EXIT line-numj }] [{ [, IOERR line-numj [,NOREC line-num] [,NOKEY line-number] RESET [FILE] The RESET [FILE] statement allws yu t repsitin an input file t its beginning r an utput file t its beginning r end. The syntax f the RESET statement is as shwn abve, where: file ref is FLO t FL9 t identify the file t be repsitined. The file must have been previusly pened with an OPEN statement. Only ne file is required in each RESET statement. The END entry is ptinal and is nly valid fr stream I/O files. REC = allws yu t specify the number f the lgical recrd t which yu want the file reset. This recrd will then be the next recrd in the file t be accessed. This parameter is valid nly fr recrd I/O files. \ ',... _._",,- KEY = r ;:::'allws yu t specify the key field in the recrd t which yu want the file reset. This parameter is valid nly fr key-indexed recrd I/O files. When a RESET statement is executed, the specified stream I/O file is repsitined s that subsequent GET r PUT file references t the file will refer t the first item in the file. When a file is pened by an OPEN statement, the first item in the file is autmatically accessible. When RESET END is specified t a stream I/O file pened fr input, the file is clsed and repened fr utput. The file is reset s that writing f new data begins at the end f any existing data in the file. If a file is t be used fr input while pen fr utput during executin f the same prgram, it must be clsed and repened with CLOSE [FILE] and OPEN statements. 168

173 ._ _._--- c) When a RESET FILE statement is executed, the specified recrd I/O file is repsitined s that subsequent READ FILE and WRITE FILE references t the file will refer t the first item in the file. When a file is pened by an OPEN FILE statement, the first item in the file is autmatically accessible. The REC= parameter allws yu t specify the number f the recrd t which yu want the file reset. The KEY= r KEY~ parameter allws yu t specify the key field within the recrd t which yu want the key-indexed file reset. If yu specify a particular key, and the system is unable t lcate that key, the recrd with the next higher sequential key is accessed if KEY~ is specified. Otherwise an errr will ccur. Ntes Abut RESET If a file specified in a RESET statement is nt currently active, the file reference in the RESET statement is ignred. NOREC, IOERR, NOKEY, and EXIT are errr recvery exits. See EXIT statement. Example In the fllwing example, the RESET statement (number 100) repsitins file FL6 t its beginning. The GET statement (number 110) then reads the first three values f file FL6 int A, 8, and C, respectively. 90 GET FL6, X,Y,Z 100 RESET FL6 110 GET FL6,A,8,C BASIC Statements _.._-._----_._---_ _....-._....., "-,,.,_._""-,, _._,----,,-,,-., _.._._----_._.. _,...-

174 RESTO R E [ cmment] RESTORE The RESTORE statement allws yu t begin assigning values beginning with the first item in the first DATA statement (see DATA) f the prgram accrding t the next READ statement executed. The syntax f the RESTORE statement is as shwn abve, where: cmment is ne r mre characters. The RESTORE statement returns the internal data table pinter frm its current psitin t the beginning f the table. The ptinal cmment is a character string that des nt affect the executin f the statement. Ntes Abut RESTORE A RESTORE statement in a prgram that cntains n DATA statements is ignred. A RESTORE statement fr an already restred data table pinter is ignred. Example After the fllwing statements are executed, the variables A and C will each have a value f 1, and Band D will each have a value f 2: 10 DATA 1,2 20 READ A,B 30 RESTORE 40 READ C,D \ 170

175 RETURN [{arith.ex p }] char exp RETURN C) Fr the use f the RETURN statement in the creatin f subrutines, see the GOSUB and RETURN statements. Als see Functin Keys. Fr the use f the RETURN statement with a multiline functin definitin, see the DEF, RETURN, FNEND. ( ~ --) -----/ c) BASIC Statements _--

176 [ KEY rel-exp Char-var}] 1 [MAT] REWRITE FI LE [USING {Iihne-num} ~ file-ref, {. } c ar-var J REC= Integer arith-var arith-var arith-arr-var char-var char-arr-var str-func MAT array-name [(rws [,clumns] )] [,EXIT line-num] [{[,EOF line-num] [,IOERR line-num] [ }J}]. ] [ { NOREC line-num,conv Ilne-num 'NO KEY line-num [MAT] REWRITE FILE The [MAT] REWRITE FILE statement allws yu t change r update an existing recrd in a file (recrd I/O). The file, hwever, must satisfy the fllwing requirements: The parameter ALL must have been specified in the OPEN FILE statement fr the file. If the KEY r REC= parameter is nt included in the [MAT] REWRITE FILE statement, the last access t the file must have been a READ FILE r REREAD FI LE statement fr the recrd t be changed. Upn executin, the variables r arrays in the [MAT] REWRITE FILE statement are transferred t a buffer fr the file reference specified. That buffer will cntain the last recrd read frm the file. If the recrd cntains a key field (fr key-indexed access), the field may nt be altered. Variable values are cnverted fr recrd utput just as they are fr the [MAT] WRITE statement, except that the X cntrl specificatin in the FORM statement causes data t be bypassed rather than blanked. The syntax f the [MAT] REWRITE FILE statement is as shwn abve, where all f the parameters have the same meaning as thse described fr the [MAT] READ FILE statement. \ '-. '... / 172

177 "... _.. _ _...._ Example A sample REWRITE FILE statement is shwn belw: 20 REWRITE FILE USING 100, FL9, REC=8,D$,F$,R$,NOREC 999 C') In this example, recrd number 8 n the file referenced by FL9 will be rewritten with variables 0$, F$ and R$ using the frmat specificatins in the FORM statement at line number 100. If recrd number 8 cannt be fund in the file, prgram cntrl will be transferred t statement 999. C) C) ') C BASIC Statements 113

178 [ {cmment }] ST P RC=arith-exp STOP The STOP statement allws yu t terminate prgram executin. The syntax f the STOP statement is as shwn abve, where: / cmment is ne r mre characters. RC = is the return cde used by the CSKIP cmmand (see Prcedure Files). When a STOP statement IS encuntered during executin f a prgram, it causes all pen files t be clsed and it terminates prcessing. The actins f the STOP statement are identical t thse f the END statement. If the RC= parameter is nt specified, it defaults t zer. If RC= is less than zer, r greater than 255, a value f zer is assumed. Nte Abut STOP A STOP statement can appear anywhere in a BASIC prgram. Example A sample STOP statement is as shwn: 110 STOP 174

179 arith-var } [ {arith-var }] USE char-var [ len] char-var [len] arith-arr (rws [,clumns] ), arith-arr (rws [,clumns])... { char-arr [len] (rws [,clumns] ) char-arr [len] (rws [,clumns] ) USE The USE statement allws yu t specify variables t be assigned t the cmmn area f strage. This cmmn area f strage hlds these specified variables and passes them frm ne BASIC prgram t the next. The values f these variables are nt changed when ne prgram CHAINs t anther prgram (see CHAIN statement). The syntax f the USE statement is as shwn abve, where: var r arr is a numeric r character variable r array that is t be assigned t the cmmn area f strage. rws, clumns are required nly fr arrays. These nnzer, unsigned integer cnstants specify the number f rws and clumns t prvide the dimensins f the array assigned t the cmmn area f strage. [len1 allws yu t specify the number f characters t be assigned t the char-var r each element f a character array. Ntes Abut." USE If a variable is defined as an array in a USE statement, it must nt be included in a DIM statement (see DIM). USE must be specified in bth the prgram chained frm and chained t. If ne r tw dimensins are specified fr a variable, the variable is assigned t the cmmn strage area as an array with thse dimensins. C) Yu can enter multiple USE statements in a prgram, but they must be the first statements cntaining variable references, and there must be n ther statements between them. Thus, fr example, the DEF, uncnditinal GOSUB, and GOTO statements can be executed befre the USE statement. Variable data is assigned in the cmmn area f strage in the same sequence in which it was entered in the USE statement. Thus, data values are unpredictable if data types differ frm ne chained prgram t the next. BASIC Statements 175

180 Example Fr instance, in this example:,/'".-..." 0290 USE A(9,4),. T, C an array (A) with nine rws f fur clumns each is assigned t the cmmn strage area. In additin, the scalar variables T and C are als assigned t the cmmn strage area. \

181 _CMATJWRITE FILE rusing {line-num},]file-ref,, \ L char-var '--) arith-var arith-arr-var char-var char-arr-var str-func MAT array-name [,EXIT line-num] } { [, EOF line-num] [, IOER R line-num] [, DUPKEY line-numj [,CONV line-numj [MAT] WRITE FILE The [MAT] WRITE FILE statement allws yu t add a recrd at the end f a recrd I/O file. The recrd is written with a length equal t the length specified in the OPEN FilE statement. The USING parameter can be used t specify a character variable (which must cntain valid FORM statement frmat specificatins) r a FORM statement. f "'--. "'-.----' FORM statement specificatins may cause truncatin r padding f character variables and cnverisn f numeric variables t varius frmats. Cntrl specificatins in the FORM statement als prvide fr changing the rder f variables in the [MAT] WRITE FilE statement when written (thrugh the POS specificatin). FORM statement cntrl specificatins als allw yu t write null fields int the recrd. If the number f variables in the [MAT] WRITE FilE statement exceeds the cntrl specificatins in the FORM statement, the cntrl specificatins will be reused frm the beginning f the FORM statement until all variables are frmatted. Recrd fields nt receiving a value are filled with blanks. Any cntrl specificatins beynd the last frmat specified will be hnred. This is helpful in psitining the cursr in device '002'. All f the parameters in the [MAT] WRITE FilE statement have the same meaning as thse described fr the [MAT] READ FilE statement. Ntes Abut WRITE FILE C) The KEY and REC parameters are nt valid in the [MAT] WRITE FilE statement. If IN was specified in the OPEN FilE statement fr the file referenced in a WRITE FilE statement, an errr will ccur. The EOF, IOERR, DUPKEY, and CONV errr exits can be entered in any rder. c) If RECl was specified in the OPEN fr this file, the file will be written frm the start. Otherwise, recrds will be added at the end f existing recrds with recrd lengths equal t thse in the file. BASIC Statements 177._---- _..._..-_._ _---_..._..._--_.._-----_...._ _..

182 Example A sample WRITE FILE statement is shwn belw: 020 WRITE FILE USING 090, FL6,A$,B$,C$,EOF 888 In this example, values fr A$, B$, and C$ are written at the end f file FL6, accrding t the cntrl specificatins in the FORM statement (line number 090). MATRIX OPERATIONS In yur system, an array can cntain either numeric r character data, while a matrix can cntain nly numeric data. Befre being used in MAT statements, arrays and matrices must have been defined; either implicitly r explicitly in a DIM r USE statement. '... MAT ASSIGNMENT STATEMENTS MAT assignment statements allw yu t assign values t elements f an array. The value assigned can be derived frm any f the fllwing array expressins. Each array expressin is discussed in detail later. Array Expressin (e) A A+B A-B A*B (e) * A IDN INV (A) TRN (A) AIDX (A) DIDX (A) Meaning Scalar value Simple array Matrix additin Matrix subtractin Matrix multiplicatin Scalar multiplicatin Identity functin Inverse functin Transpse functin Index functin (ascending rder) Index functin (descending rder) \ '-_..,- 178

183 .. _------_._-_._._ _....._._ _.. _... _ c) MAT ASSIGNMENT (SCALAR VALUE) MAT array-name [(rws [,clumns] ) ] This statement allws yu t assign a specified scalar value t each element f an array. The syntax f this statement is as shwn abve, where: = (scalar-exp) array name is the name f the array that receives the values. c' rws, clumns are the redimensin specificatins f the array (see Redimensining Arrays). sca/ar-exp is the value t be assigned. When this statement is executed, the parenthesized scalar expressin is evaluated and each element in the named array is set t that value. If redimensin specificatins are included, the truncated integer prtin f each expressin in rws, clumns is used t redimensin the array befre the scalar value is evaluated and assigned t each f the array elements. Fr character arrays, if the expressin value is shrter than the array element, it is padded n the right with blanks t the specified length befre being assigned. If there are mre characters in the expressin value than the array element length, nly the leftmst characters are assigned t the array elements, and the remainder is truncated. Ntes Abut MAT (Scalar) The scalar expressin t the right f the equal sign must be f the same type (arithmetic r character) as the array t which it is assigned_ If redimensin specificatins fllw the array name, the rules as stated under Redimensining Arrays in Chapter 3 must be fllwed. BASIC Statements 179

184 Example The fllwing example shws the executin f a MAT assignment (scalar) statement: 40 DIM Y (3,3) 50 MAT Y(2,2) = (1) The resulting values are: Clumns ~ Y is Rws... ".,/ 180

185 _.-._ _-_._..._ MAT array-name [(rws, [clumns] ) ] = array-name MAT ASSIGNMENT (SIMPLE) The simple MAT assignment statement allws yu t assign the elements f ne array t anther array. The syntax f this statement is as shwn abve, where: array-name is the name f the array. rws, clumns are the redimensin specificatins fr the first array (see Redimensining Arrays in Chapter 3). Each element f the array specified t the right f the equal sign is assigned t the crrespnding element f the array specified t the left f the equal sign. If redimensin specificatins fllw the name t the left f the equal sign, the truncated integer prtin f each expressin value in rws, clumns is used t redimensin the array befre values are assigned t it. Ntes Abut MAT (Simple) Bth arrays specified must be the same type (arithmetic r character). Bth arrays specified in the array assignment statement must have identical dimensins (after redimensining, if any). If redimensin specificatins are included, the rules described under Redimensining Arrays must be fllwed. c BASIC Statements 181

186 Example The fllwing example shws the executin f a MAT assignment (simple) statement:,/'~ 20 DIM A(2,2),B(2,2) 100 MAT A = 8 \.,," " The resulting values are represented belw: a b e f If B = and A = c d 9 h then, after statement 100: a b a b B A c d c d 182

187 ---_...,._.._......_ _...'..... MAT matrix-name [(rws [,clumns] I] = matrix name {~} matrix-name MAT ASSIGNMENT (ADDITION AND SUBTRACTION) The MAT assignment statement allws yu t add r subtract the cntents f tw matrices and assign the result t a third matrix. The syntax f the statement is as shwn abve, where: All parameters f the statement are the same as thse fr ther MAT assignment statements. L~""" / The crrespnding elements f the matrices specified t the right f the equal sig~ are added r subtracted, as indicated, and the result f the peratin is assigned t the crrespnding elements in the matrix specified t the left f the equal sign. If redimensin specificatins fllw the matrix name t the left f the equal sign, the truncated integer prtin f each expressin value in rws, clumns is used t redimensin the matrix befre values are assigned t it. Ntes Abut MAT (Additin and Subtractin) All three matrices must be numeric. All three matrices specified in the statement must have identical dimensins (after redimensining, if any). If redimensin specificatins are included, the rules described under Redimensining Arrays in Chapter 3 must be fllwed. BASIC Statements 183

188 Examp'~ The fllwing example shws executin f this statement: ".--"---- / ' 10 DIM X(3,3), Y(2,2), Z(2,2) 100 MAT X (2,2) ;: Y + Z /""'- The resulting values are: a b e a+e b+f If Y::; and Z =, then X ::::; /""- c d 9 h c+g d+h \... - '" c 1~4

189 ._------_._..._..._..._._ _-.... _..._----- C) C -- \ ) MAT matrix-name [(rws,clumns) ] MAT ASSIGNMENT (MATRIX MULTIPLICATION) This statement allws yu t perfrm the mathematical matrix multiplicatin f tw numeric matrices and assign the prduct t a third matrix. The syntax t this statement is as shwn abve, where: all parameters in the statement are the same as thse fr ther MAT assignment statements. = matrix-name * matrix-name In matrix multiplicatin, a matrix (A) f dimensins (p,m) and a matrix (B) f dimensins (m,n) yield a prduct matrix (C) f dimensins (p,n) such as that fr i = 1,2...,p and fr j = 1,2...,n: m C(i,j) = ~ k = 1 A(i,k)* B(k,j) If redimensin specificatins fllw the matrix name t the left f the equal sign, the truncated integer prtin f each expressin value in rws, clumns is used t redimensin the matrix befre values are assigned t it. Ntes Abut MAT (Matrix Multiplicatin) All three matrices specified must be numeric. If the matrix specified t the left f the equal sign is the same as either matrix t the right f the equal sign, yu will get incrrect results. All f the fllwing relatinships must be true (after redimensining, if any) where: A = B*C 1. All three matrices must be tw-dimensinal 2. The number f clumns in the secnd matrix (B) must be equal t the number f rws in the third matrix (C). C: 3. The number f rws in the first matrix (prduct matrix A) must equal the number f rws in the secnd matrix (B). 4. The number f clumns in the first (prduct matrix A) must equal the number f clumns in the third matrix (C). If redimensin specificatins are included, the rules described under Redimensining Arrays in Chapter 3 must be fllwed. BASIC Statements 185

190 Example The fllwing example shws the executin f this MAT assignment stat~mtmt: 10 DIM X(2,2), Y(2,2), Z(2,2) / 100 MAT Z ::; X * Y The resulting values are: a b e f If X;::; and Y:;:;,then Z;::; c d 9 h 'I ',,- 186

191 MAT matrix-name [(rws [,clumns] I] ~ (arith-expl*matrix-name MAT ASSIGNMENT (SCALAR MULTIPLICATION) This statement allws yu t multiply the elements f a numeric matrix by the value f an arithmetic expressin, and assign the resulting prducts t the elements f anther numeric matrix. The syntax f this statement is as shwn abve, where: ' CI matrix-name is the name f a numeric matrix. rws, clumns are redimensin specificatins (ptinal). (arith-exp) is a scalar arithmetic expressin, which must be enclsed in parentheses. The scalar expressin is evaluated, and each element in the matrix t the right f the equal sign is multiplied by the value f the expressin. The result is assigned t the crrespnding elements f the matrix t the left f the equal sign. If redimensin specificatins fllw the matrix name t the left f the equal sign, the truncated integer prtin f each expressin value in rws, clumns is used t redimensin the matrix befre the multiplicatin. 1''-- ' ~ Ntes Abut MAT (Scalar Multiplicatin) Bth matrices specified must be numeric. Bth matrices specified must have identical dimensins (after redimensining, if any). If redimensin specificatins are included, the rules under Redimensining Arrays in Chapter 3 must be fllwed. BASIC Statements 187

192 Example The fllwing example shws executin f a MAT assignment statement: 20 DIM X(2,2), Y(2,2) 100 MAT Y = (4) * X ~-'- The resulting values are: a b 4*a 4*b If X =, then Y = c d 4*c 4*d /----- \ '-- - '-.. _" ( -"...,,.'.'/ 188

193 _..._.._... ",'..._---_ _...,._..,..._.,,,..,.... MAT matrix-name [(rws,clumns)] = ION MAT ASSIGNMENT (IDENTITY FUNCTION) This statement allws yu t make a numeric matrix assume the frm f an identity matrix. The syntax f the statement is as shwn abve, where: all the parameters are the same as thse fr ther MAT assignment statements, and ION specifies identity matrix. Each element f the specified matrix fr which the values f bth subscripts are equal, fr example, A(2,2) r A(3,3), is assigned the integer value 1. All ther elements, fr example A(2,3) r A(3,1), are assigned the value O. If redimensin specificatins fllw the matrix name, the truncated integer prtin f each expressin value in rws, clumns is used t redimensin the matrix befre the assignment f 1 r 0 t each f its elements. Ntes Abut MAT (Identity Functin) The matrix specified must be numeric. The specified numeric matrix must be a square matrix; that is, the number f rws must equal the number f clumns (after redimensining, if any). If redimensin specificatins are included, the rules under Redimensining Arrays, in Chapter 3 must be fllwed. BASIC Statements 189

194 Example The fllwing example shws the executin f a MAT (identity functin) statement: 50 DIM X(16) 60 MAT X(4,4) = ION The resulting values are: X is

195 MAT matrix-name [(rws, clumns) ] = I NV (matrix-name) MAT ASSIGNMENT (INVERSE FUNCTION) This statement allws yu t assign the mathematical matrix inverse f ne matrix t anther matrix. The syntax f the statement is as shwn abve, where: all parameters are the same as thse fr ther MAT assign~ent statements, and INV specifies the inverse functin. The matrix inverse f the matrix specified t the right f the equal sign is assigned t the matrix specified t the left f the equal sign. Fr the square matrix A f dimensins (m,m), the inverse matrix B, if it exists, is a ma.trix f identical dimensins such that: A*8 = B*A = I where I is an identity matrix. Nt every matrix has an inverse. The system functin DET (see System Functins) can be used t determine whether a given matrix has an inverse. The inverse f matrix A exists if DET(A),c O. If redimensin specificatins fllw the matrix name t the left f the equal sign, the truncated integer prtin f each expressin value in rws, clumns is used t redimensin the matrix befre values are assigned t it. Ntes Abut MAT (Inverse Functin) Bth matrices specified must be numeric. 80th matrices specified must be square, and bth must have identical dimensins (after redimensining, if any). The determinant is cnsidered zer and the matrix singular (inverse undefined) if the result is 1 E-20 r less. If redimensin specificatins are included, the rules under Redimensining Arrays in Chapter 3 must be fllwed. BASIC Statements _....._..."..._-----

196 I Example The fllwing example shws executin f a MAT (inverse) statement: 20 DIM X(2,2), Y(2,2) 80 IF DET (Y) = 0 GOTO MAT X = INV (Y) 295 GOTO PRINT 'SINGULAR MATRIX' 310 STOP / ' ( The resulting values are: 2-1 If Y is, then X is 2-1 c 192

197 _-_..._-_..._ MAT ASSIGNMENT (TRANSPOSE FUNCTION) MAT array-name [(rws, clumns) ] = TRN (array-name) C) C " I This statement allws yu t replace the elements f ne array with the matrix 'transpse f anther array. The syntax f the statement is as shwn abve, where: all parameters in the statement are the same as thse fr ther MAT assignment statements, and TRN specifies the transpse functin. The transpse matrix f the array specified t the right f the equal sign is assigned t the array specified t the left f the equal sign. The values in clumn y f ne array becme the values in rw y f the ther array. If redimensin specificatins fllw the ~rray name t the left f the equal sign, the truncated integer prtin f each expressin value in rws, clumns is used t redimensin the array befre values are assigned t it. Ntes Abut MAT (Transpse Functin) Bth arrays specified must be tw-dimensinal, and the number f rws in each array must be equal t the number f clumns in the ther (after redimensining, if any), and they must be the same type (character r numeric). The same array cannt be used n bth sides f the equal sign. This will cause incrrect results. If the redimensin specificatins are included, the rules under Redimensining Arrays in Chapter 3 must be fllwed. c BASIC Statements 193

198 Example The fllwing example shws the executin f a MAT (transpse functin) statement: 40 DIM A(3,2), 8(2,3) 80 MAT 8 = TRN(A) The resulting values are: a d If A is b e, then B is c f D d e f '..."

199 MAT matrix-name [(rws) ] = AIDX (array-name) C ' ) C) MAT ASSIGNMENT (ASCENDING INDEX) This statement allws yu t index the elements f an array and assign the index values t anther array. Character arrays are indexed alphabetically, and numeric arrays are indexed numerically. The syntax f the statement is as shwn abve, where: matrix-name, array name are ne-dimensinal character r numeric arrays., rws is the dimensin f the array named. AIDX indicates the ascending index functin. When a MAT AI DX statement is executed, index values are assigned t the matrix n the left f the equal sign, accrding t the rder f the values entered int the array n the right f the equal sign. In ther wrds, the system determines the sequence f the values, then indicates the psitins in the array f the values in ascending rder. Ntes Abut Ascending Index 80th arrays specified must be ne-dimensinal with the same number f elements. The array n the left f the equal sign must be numeric. Example The fllwing example shws the executin f a MAT AIDX statement: 30 DIM A(10),8(10) 40 MAT 8 = AIDX(A) If array A = then array 8 will cntain Nte that the numbers in array 8 shw the psitin f the numbers in ascending rder as they appear in array A (0 is in the furth psitin, 1 is in the ninth psitin, and s n). BASIC Statements 195

200 MAT matrix-name [(rws)] = DIDX (array-name) MAT ASSIGNMENT (DESCENDING INDEX) This statement allws yu t index the elements f an array and assign the index values t anther array. Character arrays are indexed alphabetically and numeric arrays are indexed numerically. The syntax f the statement is as shwn abve; where, all f the parameters have the same meaning as thse fr the ascending index statement (AIDX). The executin f the descending index statement is the same as executin f the ascending index statement (AIDX) except that arr~y elements are indexed in descending rder. Ntes Abut Descending Index 80th arrays specified must be ne-dimensinal with the same number f elements. The array n the left f the equal sign must be numeric. Example The fllwing example shws the executin f a MAT DIDX statement: 30 DIM A(10),8(10) 40 MAT 8= DIDX(A) If array A = then array 8 will cntain Nte that the numbers in array 8 shw the psitin f the numbers in descending rder as they appear in array A (9 is in the first psitin, 8 is in the seventh psitin, and s n). 196

201 _... _._.._..._ _. _._._._----_......_ Chapter 5. Mre I nfrmatin Abut Yur System 5110 BASIC COMPATIBILITY WITH IBM 370/VS BASIC The BASIC language used in the 5110 differs frm IBM 370/VS BASIC in the fllwing areas: c' I System file reference cdes are limited t FLS,FLP, and FLO-FL9, which appear in I/O statements as unquted strings. Duble qutatin marks are nt available. System OPEN statements cntain mre infrmatin than VS BASIC. The system prvides hexadecimal cnstants, which are enclsed in single qutatin marks and preceded by X. The system prvides ascending/descending index n MAT assignment statements (AIDX/DIDX). c' The system allws yu t direct frmatted utput t either the printer, r the display screen, r a tape/diskette file. This capability is prvided thrugh an additinal parameter (FLP) in PRINT, MAT PRINT, PRINT USING, and MAT PRINT USING statements. An entry f FLO-FL9 in this psitin directs utput t the file referred t in a crrespnding OPEN statement. VS BASIC uses PRINT TO statements fr this purpse. The system allws yu t specify file descriptin infrmatin that is prvided by the perating system (in 370/VS BASIC) via the OPEN [FILE] statement. The system allws yu t CHAI N t a specified prgram withut initializing the data area reserved by variables specified in a USE statement. The system allws yu t list data in the USE statement, including dimensins fr arrays. In cnjunctin with a CHAIN statement, the USE statement allws yu t pass data frm ne prgram t anther. The system des nt prvide the fllwing VS BASIC functins: CLK,CNT,CPU,DAT(x), DOT(X,Y), JDY(x), and TIM. Mre In frmatin Abut Yur System 197

202 The system prvides errr exit clauses n INPUT and PRINT statements. The system requires statement numbers with values up t 9999, and permits special functins t be assigned by the user t numbers The system des nt supprt ascending/descending srt (ASORT /DSORT) n MAT assignment statements. The system des nt supprt the ELSE clause n the I F statement. The system des nt supprt the verflw/underflw and INERR clauses n the ONERROR statement. The system des nt recgnize the exclamatin (!) symbl in an image statement, althugh the symbl can be entered by verstriking the single qutatin mark and decimal pint. BASIC COMPATIBILITY WITH IBM 5100 BASIC Any syntactically valid 5100 BASIC SOURCE prgram will run n the 5110 except when pening a file with negative file numbers. Negative file numbers will cause an errr. The internal data frmat f the 5100 is packed decimal; the internal frmat f the 5110 is binary. Therefre, the results f calculatins that use decimal fractins may nt be the same in the 5110 as they were in the Fr mre infrmatin n hw decimal fractins are used in calculatins, see the IBM 5110 BASIC Intrductin. Als, any 5100 prgrams that use a hexadecimal cnstant t generate characters will generate different graphics with the When the user is pening a file fr input and specifying a character variable fr identificatin, the user I D frm the file is nt placed in the character variable as it is in the The range f valid numbers fr the 5110 differs frm the Cnstants greater than 7.237E75 and less than E99 are nt accepted by the In additin, cnstants with magnitude less than E-79 and greater than 1 E-99 are nt accepted by the c:~ 198

203 _ _.._..._... TAPE CARTRIDGE HANDLING AND CARE Prtect the tape data cartridge frm dust and dirt. Cartridges that are nt needed fr immediate use shuld be stred in their prtective plastic envelpes. Keep data cartridges away frm magnetic fields and frm ferrmagnetic materials which might be magnetized. Any cartridge expsed t a magnetic field may lse infrmatin. D nt expse data cartridges t excessive heat (mre than F r 54 0 C) r sunlight. D nt tuch r clean the tape surface. If a data cartridge has been expsed t a temperature drp exceeding 30 0 r _1 0 C since the last usage, mve the tape t its limits befre using the tape. The prcedure fr mving the tape t its limits is: F 1. Use the UTIL cmmand t mve the tape t the last marked file. 2. Use the MARK cmmand t mark frm~he last marked file t the end f the tape. Fr example: MARK 200,1,n where n is the number f the last marked file, plus ne. This will cause an errr (end f tape). Press the A TIN key t cntinue. 3. Use the REWIND cmmand t rewind the tape. Mre Infrmatin Abut Yur System 199

204 STORAGE CONSIDERATIONS The fllwing list shws hw many bytes f strage are required fr each data type that can be stred in the wrk area: / Data Type Character variable 18-byte frmat Number f Bytes Required 22 Character variable nt 18-byte frmat Length f the variable plus 5 Character array 18-byte frmat Character array nt 18-byte frmat Numeric variable, lng precisin Numeric variable, shrt precisin 18 times the number f elements plus 10 Element length times the number f elements plus Numeric array, lng precisin Numeric array, shrt precisin 8 times the number f elements plus 10 4 times the number f elements plus 10 \... -_/ Because the 5110 wrk area cntains a fixed amunt f strage, it is a gd practice t cnserve as much strage as pssible. ( " \,. ' 200

205 --_._ ""'-_.'-"'".. _--... ""--_._... _ _..._" _-_... _._._ DISKETTE HANDLING AND CARE Operatin C) c) Diskette Insertin CAUTION If a diskette has been expsed t temperatures utside the recmmended range (50 0 F t F r 10 0 C t 51 0 C), keep it at rm temperature fr abut five minutes befre inserting it in the drive Open the diskette drive cver. Remve the diskette frm its envelpe by grasping its upper edge and lifting Insert the diskette int the drive by grasping the diskette by its upper edge and carefully placing it in the drive. Clse the cver nly after the diskette has been fully inserted. Diskette Remval C.) Open the diskette drive cver. Remve the diskette by grasping its upper edge and pulling it straight ut. Slide the diskette int its envelpe and return it t a clean strage area. Handling Defective Cylinders C) With use, areas can develp n the disk surface n which readable recrds cannt be written. A diskette with a defective area shuld nrmally be remved frm service. The 5110 is capable f reinitializing diskettes and assigning up t tw alternate cylinders. In this case, d nt use a diskette with a defective area befre reinitializing it t bypass the cylinder cntaining the defective area. Then recrd the number f the defective cylinder n the permanent label.. C),.,--', U Mre Infrmatin Abut Yur System 201

206 If diskette errrs ccur,' yu must make a decisin regarding replacement f indiviual diskettes. The fllwing prcedures can help with this decisin: When using a new diskette, assign a serial number t it and recrd that number n the diskette permanent label and in the space prvided in the diskette internal label (vlume ID field). Keep a lg f diskette serial numbers and the initial date used s yu can estimate wear by the diskette age.,r'--, Whenever a diskette errr ccurs n the same cylinder repeatedly, reinitialize the diskette as sn as pssible. T reinitialize, first cpy any useful data frm the diskette. As part f the initializatin rutine, the device assigns cylinder and sectr numbers t the diskette, bypasses the defective cylinder, and assigns the cylinder r.umber f the defective cylinder t the next gd cylinder. Fr tw-sided diskettes, bth tracks f a cylinder must be relcated if either is defective. Tw defective cylinders per diskette can be replaced in this manner. Peridically examine the lg f diskette serial numbers and the permanent labels n the diskettes. If a diskette is t ld fr further use, r if there are mre than tw defective cylinders, replace the diskette. Handling Precautins Replace the diskette if it is physically damaged (trn, flded, creased), r if the recrding surface becmes cntaminated. It is particularly imprtant that yu d nt use diskettes which are cntaminated with sticky fluids (sft drinks, cffee) r abrasive substances (metal filings) n the recrding surface. Placing a cntaminated diskette in a device can cntaminate the read/write head, causing peratin errrs. In additin, cntaminants can be passed t clean diskettes. A substance spilled n the diskette jacket can be remved and the data recvered nly if the cntaminant des nt reach the recrding surface. After recvering the data, discard the diskette. ",--- (, '-... / 202

207 _.._ _-----_._-_._--_._._._..._-_..._ T remve a diskette frm its envelpe, grasp the diskette by its upper edge and pull. c Return the diskette t its prtective envelpe whenever it is remved frm the diskette drive and whenever yu are writing n a label n the diskette. D nt bend r fld the diskette. D nt use rubber bands r paper clips n the diskette. D nt tuch r clean the expsed diskette surface C) c) u Mre Infrmatin Abut Yur System 203

208 D nt smke, eat, r drink while handling the diskette. (,-- -" D nt expse the diskette t excessive heat r sunlight. / / /' D nt use magnets r magnetized bjects near the diskette: Data can be lst frm a diskette that is expsed t a magnetic field., 204

209 ... _.._... _._.. _._... _ D nt place heavy bjects n the diskette. C) D nt erase labels attached t the diskette, r make any erasures n r near the diskette. Erasure residue culd get in the diskette, and this shuld be avided. T discurage erasures, IBM recmmends that yu use a fiber-tip r ball-pint pen when marking n the diskette labels. Mark temprary labels befre attaching them t the diskette. Alter temprary labels with the diskette in the envelpe. C) D C '" ) Mre Infrmatin Abut Yur System 205

210 Strage Envirnment r--. / Temperature: 50 0 F t F (10 0 C t 51 0 C) Relative humidity: 8% t 80% Maximum wet bulb temperature: 85 0 F (29 0 C) Shrt-Term Strage Stre diskettes needed fr immediate use flat in their envelpes, in stacks f ten r less. If string vertically, supprt the diskettes s they d nt lean r sag. ( ~- " ' Lng - Term Strage Stre diskettes nt needed fr immediate use in their riginal shipping cartns, with each diskette in its prtective envelpe. Shipping cartns can be stred either vertically r hrizntally. CAUTION D nt apply pressure t diskette envelpes r cartns, because pressure can warp the diskettes. 206

211 Shipping and Receiving When shipping a diskette, always label the package DO NOT EXPOSE TO HEAT OR SUNLIGHT. When receiving a diskette, check the cartn and the diskette fr damage. T pack ne diskette: Place the diskette in its prtective envelpe. Put the envelpe in a single-diskette cartn. c) T pack muliples f 10 diskettes: Place each diskette in its prtective envelpe. Put 10 diskettes in a 10 diskette bx. Put each 10-diskette bx between spacers t prevent damage during shipping. Insert tp and bttm pads in the cartn. Place the 10-diskette bxes and their spacers in the apprpriate size cartn. Fill the pen space in partially filled cartns and 10-diskette bxes with a filler that cannt cntaminate the diskette r enter the diskette jacket. CAUTION D nt use s much filler that diskettes are tightly cmpressed; cmpressin can warp the diskettes. Mre Infrmatin Abut Yur System _----_._ _ _._---_ _-----_.-

212 208

213 ... Appendix A BASIC Characters and Hexadecimal Representatin The fllwing chart lists all the EBCDIC characters and their hexadecimal representatin. Bits 4 thrugh 7 ( I I I ) Bits 0 thrugh 3 c.~) A B C D E F A M... B.. C ~ D E.... F.. r J.- H M_... I <::,.:: ( + I 5 &..J M K I....- M... N ()..... P - ~~... I~! $ ) MM 6 I S T U V kl X Y Z, I %.M &.. b. ltj v \, tt (~, 7 1\. 8 N a b r- ei (-~ f <.~ h i t J, ::; r "*, I ::. M I.. -,!> " ~ 9 n j I< l m n 0 p q r ::> c 0 ~- A.- ti S t u V hi X Y z n u.i. r ;:: 0 B (X +? \ (J (,) )( \ \7 t.\ T ::I "I I N N C -{ A B C II E F r :J H I (' A v,. (~ ITI ~~ D )- J K I... tvl N () P (~ R :It: I 't' ~ rl A E \ (...,:) T U V W X Y Z f \..c. 1" r) F 0 1 A: ""1 B 9 I.,., t Fr example, the character 0 has value f X' FO.. (f).t. Nte: Graphics are assigned t all blank psitins, except hex 40, fr maintenance use nly. They are incmpatible with ther systems and cannt be used fr exchange purpses. These graphics may be remved r changed as a result f maintenance r new versins f this prduct BASIC Characters and Hexadecimal Representatin 209

214 In the fllwing illustratins (Figures 11 and 12), the characters n the keys crrespnd t the fllwing diagram. KEYBOARD CHARACTERS FOR XXX X T f~nfi~rfi-~~ je i I ER~~~Ef~R-R5fi~ I I,,,,,--;----;----;---;---, ---~--;-,,,,, I I NO SHIFT I I I UPPER SHIFT I 1 I I COMMAND SHIFT I I I I LOWERCASE I I CHA~~Ef~~-R5DE I I,,,,,---;-'--;---;----:--, --~---:,,,,, 1 1 NO SHIFT I I I UPPER SHIFT I 1 I I COMMAND SHIFT I I 1 I I... " 210

215 r\ ''-.- ' (\ \ ; '- -- n \ / "----' r,,; ',~, ~ Il:J» en n (") ::r ~ Dl ~ ~ en Dl ::J Q. ::r: CD X Dl Q. CD n 3' ~ :lj CD ~ ~ CD ~ ~ 0' ::J "T1 ce' I:... CD...&... ~...& ~ CD < C O Ql a. :r Ql... Ql (") r+ CD Cil I---i-----l---~-----T---j-----I---ij-----I---~-----I ; I I I.:: I 1 1 1::- 1 I v I All ~ 1 1 LOAD 1 SAVE 1 RUN 1 GO 1 LIST 1 UTIL 1 AUTO 1 RENUM 1 result 1 MARK 1 m 1 cpy :3 1 ll_ 1 5 f x 1 1 I I.:: I::; 1 1 ;:: 1::- 1 1 v 1 All ~ 1 1 LOAD 1 SAVE 1 RUN 1 GO 1 LIST 1 UTIL 1 AUTO 1 RENUM 1 result 1 MARK 1 m 1 cpy 1 I---~-----I---C-----I---E-----I---k-----T---f-----y---y-----y---O-----T---j-----Y I---~-----y---~-----y---;-----I I? I (J I.;: I p lit I! 1 \ 10 1 * I -t CHAIN I CLOSE I DATA 1 DEF I DIM I EXIT 1 FILE 1 FNEND I FOR I FORM I I II I q 1 w 1 e t 1 y 1 u 1 i p 1 ~ Q 1 W 1 E I R I T I Y 1 lj I I 1 DIP 1 -t 1 1 I? 1 (J I.;: 1 p lit I! I 1 a 1 * 1 1 tj I---~-----I I---fi-----I---f-----f---~-----I---R-----I---]-----I---R-----T---C-----T---E-----T---j-----T---ij-----i 1 air 1 L. 1 1 V 1 fl ( I) I@ 1 1 GET 1 GOSLIB 1 GOTO 1 INPUT 1 MAT 1 NEXT 1 OPEN 1 PAllSE 1 PRINT 1 { I) a 1 sid 1 fig 1 h 1 j 1 k 1 I 1 [ I] I.. I I A 1 SID 1 FIG 1 H 1 J 1 K I L,I ( I) I@ I 1 a I r I L. I I V I fl I I 10 I { I)- 1 1 T---~-----I---~-----I---E-----I---Q-----I---~-----I---~-----i---R-----i i i i---i-----I I c I::> 1 n 1 u 1 lit \ 1.& 1 1 PUT 1 READ 1 RESET IRESTORE 1 RETURN I USING 1 WRITE 1 lie I z 1 x 1 c 1 v 1 bin 1 mil 1/ 1 $ 1 1 Z 1 X 1 C 1 V 1 BIN 1 Mil 1 \ 1 & 1 1 c l:l 1 n 1 tj I 1 \ 1 ell I\.) -"

216 i... -c MM MM... MM... I I 1 I I I k I, I I I 1 J I I 1 I 1 I 1 I 0- I 0-1 I I II 10- "t: "0 I -"t: "C 1! EEl I U WI! 1 IMM..., c _... I 1 I I! I 00 I CO 1 I I II 100 j- "C 0:; j- "C 1 I E EI I U WI I 1... IMM MM _... MM _ I I 1 I I I I I I'- 1'-1 I I II Ii"- 0:.,. "C I'- 0:.,."0 1 I E EI I U U 1 I _ c _... I 1 1.! I 1 1 I 1 1* - I lie I 1! I "'" I I I I I -0 1 I I II 1-0 "C 1-0 "C 1 1 EEl I U I U!! 1, "'"1 I 1 1 1! 1! I;") Ii") 1 I I I I!i./") "C I ~'") "C 1 lee! I U I U! I 1 I I 1 1.:T 1.:T 1 1 II! I:::i" "C!.:T "C I 1 EEl I U lui 1 I 1- MM "'" 1 I"'" - """... _ ! I! II! : I I i i I... -"'" I I 1 : 7 ~1: It<') "C I i"') "C! I E EI i U U I I I 1... _... _1 I!! I!. (,.J I (".J; I! 1! I(, J I "C I (,, jl 'T.:! I 1 E E! lui U I 1 I _... - I 1 I 1 I 1.,...; 1.,...; I 1 1 I I :~ - "'C i - "0 j lee I 1 U I U I 1 I!_ _I _... 1 I 1 I :! I!!!:.M... I,! I! 1! ~ _. 1 ~ -' 1 : : 1 1, I 1 I 1 1 i 1 I I i I 10 'T.:!! 0 "CI lee 1 1 U 1 U 1 I MM I / Figure Keybard Characters c_~ 212

217 ..._-..._...._ _... -_.._-----_...._-_._-_.._----- Appendix B Printer The 5103 Printer has the fllwing characteristics: C~) r U Bidirectinal printing (left t9 right and right t left). The print head mves frm the left margin and prints a line. Succeeding lines will be printed in either directin depending n which end f the new line is clsest t the current psitin f the print head. The print head will be returned t the left margin peridically when printing is nt imminent. A maximum print line f 132 characters. Nte: If 132 characters are frmatted fr frms less than 132 characters wide, lss f data will ccur as the print head leaves the frm. Capability f using individual r cntinuus frms. Maximum number f cpies is six, but fr ptimum feeding and stacking, IBM recmmends a maximum f fur parts per frm. Adjustable frms tractr that allws the use f varius width frms. The frms can be frm 3 t 14.5 inches (76.2 t mm) wide fr individual frms, and frm 3 t 15 inches (76.2 t 381 mm) wide fr cntinuus frms. Print psitin spacing f 10 characters per inch (2.54 em) and line spacing f six lines per inch (2.54 em). Stapled frms r cntinuus card stck cannt be used. The character printing rate is 80 r 120 characters per secnd. The thrughput in lines per minute is prgram-dependent. A vernier knb (lcated n the right side f the printer) that allws fr fine adjustment f the printing psitin. This knb shuld nly be used when the print head is in its leftmst psitin Printer 213

218 HOW TO INSERT FORMS Cntinuus Frms 1. Slide the printer cver frward. Frm Guide Rack Push the print head t the extreme left psitin. Fr singlepart frms pivt the frm guide rack up and frward t a vertical psitin. Fr multipart frms, leave the frms guide rack in the hrizntal psitin. The diagrams belw shw the prper frms path fr singlepart and multipart frms. 1 ~f.;.: Release Lever j-;.per.ldvance Knb Vernier Knb Push the paper release lever t the rear t activate the frictin feed rlls. Place the frms n the table behind the printer. Nte: The frms must be psitined behind the printer s that the frms feed squarely int the printer. Thread the paper dwn, ver the rllers, behind the tractrs, and behind the platen. Turn the paper-advance knb t mve the paper arund the platen until yu can grasp it with yur fingers. Frms Path fr Singlepart Frms Frms Path fr Multipart Frms /Frms Guide Rack ~========~=: \(in lwer psitin) ~~~~!!.;;:~~iiit Frms Guide Rack Psitin these guides (----' at the edge f the pape~>. 214

219 --_._....-._._--_..._.._ _.. _..._.-._._._ Tractr Cver and Pins Open bth tractr cvers. Pull the paper release lever frward t disengage the frictin feed rlls. 10. Pull the paper up and place the left margin hles ver the tractr pins. Be sure the left tractr is in its leftmst psitin. 11. Clse the left tractr cver. C "', ) 12. Squeeze the tw knbs n the right tractr and slide the tractr t align the pins with the right margin hles. 13. Place the right margin hles ver the tractr pins. 14. Clse the right tractr cver. 15. Fr singlepart frms, pivt the frm guide rack t a hrizntal psitin. Right Tractr Knbs 16. Turn the paper-advance knb t psitin the frm fr the first line t be printed. The paper shuld exit ver the frms guide rack. Nte: T mve the frm backward, turn either paper-advance knb backward and pull the frm frm behind the printer t keep the frm frm buckling at the print head Slide the printer cver clsed. The plastic guides n the rear f the wire rack shuld be psitined (ne n each side f the frms) s as t aid in guiding the frms fr prper feeding. These guides are psitined by slidin{:j them back and frth. CAUTION The switch that senses end f frms is deactived when the frictin feed rlls are engaged. Thus, the print wires culd hit the base platen if n frms are in the printer Printer 215

220 Cut Frms 1. Remve the frms tractr by tilting it back and lifting it ff. 2. Mve the cut frms guide frward. 3. Slide the printer cver frward. 4. Push the print head t the extreme left psitin. 5. Push the paper release lever t the rear t activate the frictin feed rlls. 6. Place the frm in psitin behind the platen and against the cut frms guide. 7. Turn the paper-advance knb t psitin the frm fr the first line t be printed. Imprve the paper alignment if necessary by using the paper release lever. 8. SI ide the printer cver clsed. CAUTION The switch that senses end f frms is deactivated when the frictin feed rlls are engaged. Thus, the print wires culd hit the base platen if n frms are in the printer. Cut Frms Guide Paper Advance Knb 216

221 ._-----_..._......_ _....._--_..._ C) HOW TO ADJUST THE COPY CONTROL DIAL FOR FORMS THICKNESS If yu are using singlepart frms, set the cpy cntrl dial n O. If yu are using multipart frms and the last sheet is nt legible, rtate the cpy cntrl dial tward 0 ne click at a time t btain the legibility yu desire. C) 3. If yu are using multipart frms and the ribbn is smudging the first sheet, rtate the cpy cntrl dial tward 8 ne click at a time until smudging stps. HOW TO REPLACE A RIBBON (PART NUMBER ) Frms Tractr ~~ 1. Turn ff pwer t the printer. 2. Tilt the frms tractr back by lifting bth sides at the frnt. 3. Slide the tp cver frward, then lift the frnt edge f the tp cver and remve it. Printer Cver POWER ON Switch 5103 Printer 217

222 Ribbn Bx Cver ~ 4. Be sure that the print head is t the extreme left. 5. Turn the feed rll release knb cunterclckwise until it pints t the right. 6. Open the ribbn bx cver. 7. Put n the glves supplied with the new ribbn. / ' 8. Remve the ld ribbn frm the guides being careful t disengage it frm the clip n the print head. 9. Lay the ribbn lp n the tp f the ribbn in the ribbn bx. Pick up the entire ribbn and discard it. Disk '''-... ',,,. Ribbn Hlder 1 O. Eject the new ribbn frm its hlder int the ribbn bx by pressing n the disk. 11. Remve the disk frm the ribbn and discard the disk and the hlder. 12. Hld the cil lightly with ne hand and pull abut 10 inches (254 mm) f ribbn frm the cil. ('' I \ 13. Frm a lp frm the ribbn acrss the print head. Lp 218

223 Upper Guide Pst Platen Feed Rlls 14. Thread the part f the lp nearest the platen between the feed rlls and n the inside f the upper guide pst. 15. Turn the feed rll release knb clckwise t clse the feed rlls. 16. Thread the ribbn between the print head and the platen. Be sure the ribbn is under the clip n the print head. 17. Thread the ther part f the lp thrugh the slt in the bttm f the ribbn bx. Left Guide Pst Guide She Slt Ribbn Bx 18. Thread the ribbn thrugh the guide she and arund the left guide pst. 19. Insert the hrizntal part f the ribbn twist (bttm edge first) between the tw hrizntal guides. 20. Mve the print head back and frth acrss the platen t remve the slack frm the ribbn. Cntinue mving the print head until yu are sure that the ribbn feeds prperly. Leave the print head at the extreme left. 21. Clse the ribbn bx cver. 22. Clse the printer cver and turn the pwer n. 23. Repsitin the frms tractr. C) 5103 Printer 219

224 INSTALLING THE 5103 PRINTER STACKER A flded-frm paper stacker is supplied with 5103 printers. The wire stacker hks nt the back f the printer cver as shwn in the drawing. The lwer wires n the stacker shuld cntact the metal clips n the cver. The stacker can be bent if t much weight is applied. Under nrmal cnditins, printed frms shuld nt be allwed t accumulate higher than 1 inch in the stacker. Nte that, because f the relatively small free-fall distance f the paper as it. leaves the printer, yu may have t manually fld the first tw r three sheets t get the flding peratin started.,,-r-', ( \'... / "

225 _.. _... _.._--..._ Appendix C, 5100 Hexadecimal Representatins These are the characters that the 5100 can display alng with their hexadecimal res presentatins. The secnd 128 characters are the same as the first 128 with the additin f underscres. { I ~/ X' 00' - X' 0:1.' _.. A X'02' - B X'03' _. C X'(}I.j '..- D X'05'._. E X'06' -- F X'O'l' _.. G X'OB' _. H X'O<j>' = I X' OA' --,.J X'OB' = I( X' OC' _.. L X'OD' - M X'OE'.- N X'OF' = 0 X'10' _. P X'l:L' - Q X':L2' _. I~ M Y X':L:'5' - S X' :1,'+'... T X'15' _. U X '1.6' _. V X':l7'..- W X'l.B' _.. X X' t (?' X'lA' -- X' lb'._. Z 0 X'lC' _. 1 X'l.D' 2 }('le' -. ~~ X' :I.F' _.. '+ X' 20'... ~:.=j X' 21'.- 6 X ":)':>' A_ X'24' -" 9 X'25' _. / X' 26'.- + X' 27' _. x X' 28' _. ~.. X' 29'... [ X ' 2A' -- ] X'2B' - X' 2D'.- r X' 2E' -.I. X' 2F'.- n X ' :3 0' _.. L. X' :31' : X'32' - X':3~5' -" 'V X'~~L~'._. IJ. X':3!7j' :: \ X ' :~6'... 0 X' 37'.- X ' 38' -- [] X' :39' _.. 1 X ' 3A' :-.: T X' :'5B'... Q X ' :'5C'... * X ' :3D'...? X' :'5E' _. p X' 3F'..- r X' 4 0'... N X "+1'..- -! X "+2' :::: u X ' Q.;3' ::: (.) X' 1+'+'... ::) X ' Lf.~5' _.. t X ' L~6' :: c:: X"+7' :: A X' 4 8'... X' 1.1 9' _. X 'I.I A'... -:: X' '+B'... ~; X' I.I e' X' Lf.D' -- ;:: X '!.J E'.- :: X ' L~F' _. ~ X' 50' :::: V X' ~:.:il'... \ X' 52'. X'~j:3' -- X' 5'+'..- -} X'55' - ( X' ~.=jb'.... X' ~::j7'.... X'~:jB'..- X'~)Cj>'..-~) X ' ~5~I'... E) X' 5B'... ~ X ' ~5C' _. Q) X ' ~.)D'.- f X ' ~:je'... \ X ' ~'=;F'.- I~ X ' bo'.... X' 61'... ~ X'62' - X X' 63' _. 0 X'6L~'... IB X ' 65' - :I: X'66' - fl X' b7'... A X' t.)b'.- ~ X'6(;>'.- ~ X' 6A'... ~ X' 6B' :::: t X' 6C' ::! X' bd'... X' 6E' _. >(, 6F'... & x '''..,0,... (~ X' '(':1.'..- U X' 72'... $ X' 73' _.. % X' 7 LI '... A X ' 7~:.:;'... lu X' 76' - () X' 77'... 0 X' 70'... A X' 79'... ff. X' 7A'... t1 X' 'let'... F.i X ' 7C'.- i. X ' 7D'... ~~ X' 71::'... 5 X'7F' :a:: A X' DO'... X' 8:1.'... A X ' 82'... ii X' B3'.- (~ X ' BL~' _. i1 X ' B~=j' -' i~ >(, 86'... f: X' 87'... G X'BB' = H X' 89'..- I X' 8A' -- J X ' BB' ~.. K X' 8e'..- [ X ' BD'..- M X' BE'... N X' BF'... 0 X' 90' _. P X'91'..- (~ X'92' = R X ' 93'... ~~i X' 9'+'... T X ' 9~5'... 0 X' (.~6'... V X' 97'... W X' (yo'... X X' 99'._. Y X' 9(.:1'... Z X ' 9B'... i)' X'9C' - I x' 9[1' _.. 2 X'9E' - 3 x' 9F'... fj: X'AO' -- ~7j x' Al'._. 6 x' A2'... ::1 X' A3' _. 8 x' A'+'..- 9 X'A~7j'..-?_.. x.' A6'..- + x' A7'... _. x X' A8'... ~.. x' A<j>'... e' X'AA' - ]' x' AD'... } X' AC'..-, X AD' X ' AE'.-.l X' AF'... n X' BO'... [ X'B:I.'..- +~ X' <2' - X'B3' - V X' B4'... ~ _.. X' B5'......, X' B6' _. 0 X' B7'... ' X' BEl'... ij X' B9' _..... T X' BA'.- T X' BB' X' Be'... ~. x ' HI)' = ';> X 'BE'.- p X' BF' _. [ X'CO' - N X 'C:I.'... ~..- X' C2' u X' C3'... (,)... X' CLf.'... ::> X ' C~j'... t'.. - X'C,1)'.. - C X' C7' :::: A X' CH'... X' C9' X' CA'... -:: X' CEt' - ::; X' CC' X ' CD.'... ~: X' CE' _. :: X' CF'... X'DO'..- ~- v X'D:!.' -- X' [12' _. \ X' [13' X' DL~' - t X '[15'... '( X' [16'... ') X'[l7' - X' DB'..- X ' [19' -- (j) X. DA' B X' DB'.- ~ X' DC' _.. (B X'[lD' - I f X' DE' -., X' [IF' _. ~ X' EO'... X'El' - ~ X'E2' X'E:3' - X' E4 '.- T N.- A ill Ei _. X' E6' = fl X' E7'.. ~ X'E8'... ~ X 'E9'...! X'EA' - ~ X' EB'.- 'f X' EC'.-.t. X' ED' ::-.:..., X' EE'..... X' EF' _.. '& X'FO' X' Fl'... n X' F2' _. ;i X' F3'... % X' FLI '... R X'F~7j'... fij X'F6'.- 0 X' F7'... l.j X'F8' - X ' F(,' _. X if: X'FA'.. ~ X ' FB' _. '" X'FC' - f. X ' FD'..- ~~ X' FE'.- (5 X' FF' _.. i~ 5100 Hexadecimal Representatins 221

226 \ '---- /" ( \.. \ 222

227 ._-_.. _-... _ _-_._...._------_.._--_._...- () C) Appendix D. BASIC Errr Messages And Operatr Recvery The fllwing list cntains all the system errr cdes. Any detected errr will deactivate keys 011 the keybard and cause the display screen t flash. T stp the flashing display, press the A TIN key. Errr cdes belw 100 are I/O errrs and are displayed as a three-digit message, fllwed by a device identifying character (E fr tape, D fr diskette, r 5 fr the printer). The device identifying character is fllwed by 80 (built-in tape r diskette drive 1), 40 (auxiliary tape r diskette drive 2), 20 (diskette drive 3), r 10 diskette drive 4). Yu can recver frm each executin errr with ne f the fllwing prcedures labeled 0, G, G r G): OEnter GO r GO END t end the prgram r enter GO x t cntinue, where x is the statement number f any statement in yur prgram. Use this recvery fr errrs that ccur during prgram executin. GEnter GO END t end the prgram r GO t cntinue. r'" ~) G Enter GO r GO END t end the prgram. G)Crrect the statement r cmmand in the input line, then press the EXECUTE key. Use this recvery fr errrs that ccur during cmmand r surce input. Nte that if errrs are detected during executin f a prgram invlving tape r diskette peratins, yu shuld enter GO END t ensure that files are prp~rly clsed. If I/O errrs (01-99) ccur n a tape file, the file is autmatically marked nt pen and cannt be accessed by GET r PUT statements. An utput file has nt been prperly clsed and may nt be accessible. GO END clses all ther files. BASIC Errr Messages And Operatr Recvery 223

228 I/O ERRORS Errr Meaning Recvery /----, 001 Diskette drive timing Retry the peratin. If the errr errr. recurs, call yur service persnnel. 002 Invalid cmmand fr An attempt t access tape file device, r invalid number 0 can cause errr 002. cmmand sequence fr An unmarked tape cartridge can device. cause errr 004. Otherwise, if the errr cntinues, call service 003 Tape hardware errr. persnnel. 004 Tape timeut. 005 Tape cartridge nt Insert a cartridge and retry the inserted. peratin. ' Tape is file-prtected. If yu want t write n the tape, turn the SAFE switch n the tape cartridge ff the SAFE psitin. 007 Tape read errr. Use the LI N K cmmand t lad the Tape Recvery prgram and recver as much data as pssible. 008 The next expected Try the peratin again. If the physical recrd cannt be errr ccurs again, cpy the files fund. A system fllwing the file that caused the malfunctin might have errrs nt anther tape, then ccurred, r the tape use the MARK cmmand and cartridge might have re-mark the tape frm the file been remved frm the that caused the errr. tape unit when data r a wrkspace was being written. The data in the file cannt be used. c.~ 009 An attempt was made t read a recrd after the end f data address. 010 End f file has ccurred Use the MARK cmmand t mark (~" during a read r a write a larger file and retry the \,- beynd the last recrd in peratin. the file. C

229 -----_..._---_.._ _.... _._._---_._..._--_ _--_._. 0 Errr Meaning Recvery 011 A tape file was specified Specify the crrect file r use the that des nt exist. MARK cmmand t mark the tape. 012 End f physical tape has Use anther cartridge. been encuntered. 013 Specified device is nt C_') attached. 014 Device errr. Try the peratin again. If the errr cntinues t ccur, call service persnnel. 015 System errr Use the initializatin Supprt ("" ccurred-vlume r Functin t reinitialize the.l.,... ~ header label cannt be diskette. read r written Faulty diskette. Cpy all available data t anther diskette, then reinitialize the diskette Hardware errr. Retry the peratin. If the errr recurs, call yur service persnnel. 024 N VOL1 label n the Reinitialize the diskette. diskette. ~.. -' 025 Invalid diskette. Reinitialize the diskette Hardware errr. Retry the peratin. If the errr recurs, call yur service persnnel. 030 Diskette drive cver was Insert the crrect diskette, clse pened and a different the diskette drive cver, and retry diskette was inserted. the peratin. 031 Faulty diskette. Cpy all available data t anther diskette, then reinitialize the diskette System errr. Retry the peratin. If the errr C;I recurs, call yur service persnnel. 038 Invalid file header. Cpy all available data t anther diskette, then reinitialize the diskette. Attempt t write t a If yu want t write t the file, write prtected file. turn ff the write prtect indicatr and then write t the file. C') /' BASIC Errr Messages And Operatr Recvery 225

230 Errr Meaning Recvery 040 An I/O peratin was Issue the cmmand using the specified with nly the apprpriate file number. file ID, and mre than ne file n the diskette have the same file ID. 041 An I/O peratin was Insert the crrect diskette and specified with nly the reissue the cmmand, r reissue file I D, and n matching the cmmand using the crrect, file ID was fund. file ID. The file name already Issue the cmmand r statement exists n the diskette. using a new file ID. / A MARK cmmand was Use the cmpress Supprt issued, but there is nt Functin t psitin all enugh unallcated unallcated strage as cntinuus cntinuus strage bytes. Then try the MARK available n the diskette cmmand again. If the errr t frmat the file(s)..ccurs again, use anther diskette Attempting t access a Use the UTIL VOLID cmmand t vlume prtected turn ff the vlume prtectin diskette. indicatr. 045 The diskette is inserted Make sure the diskette is inserted incrrectly. crrectly and try the peratin again. 050 Printer has detected end Insert new frms. If the errr f frms. ccurs n a cmmand peratin, reenter the cmmand. If the errr ccurs during prgram executin: /---,../ Enter GO x t cntinue, where x is the statement number displayed. This may cause the last line t be printed twice. 051 Printer is nt ready. Turn n the printer. If the errr ccurs n a cmmand peratin, reenter the cmmand. If the errr ccurs during prgram executin: (~-. Enter GO x, where x is the statement number displayed Printer errrs. Check that the frms tractr pins and the platen are nt engaged (/ simultaneusly. I, " elf errr recurs, call service persnnel. ( "- 226

231 _..... "..._-_._--_..._----_... _..._..._... -" () Errr 054 Meaning The printer was turned ff within tw secnds after a system cmmand was entered. The errr cntinues t ccur when the printer is turned n again. Recvery Save any data in the wrkspace, then enter the LOADO cmmand t get the printer int synchrnism with the Printer errrs. See errr System errrs. If errr recurs, call service persnnel. EXECUTION ERRORS Nrmal executin errrs are simply displayed as three-digit messages, as shwn in the fllwing list. Errr Meaning Recvery ( '-.-' 500 Syntax errr in OrG) statement, in key grup header, r in FORM specificatin frm a character variable during prgram executin. 502 Unbalanced parentheses e in expressin. 503 Missing delimiter G) between character cnstants. 505 First statement fllwing G) a LOADO, KEYX was nt a header statement. 506 Invalid line number fr G) KEY specified. 507 Statement type nt G) allwed in BASIC KEY grup. 508 Size f dimensins is nt G) in the range f 1 t 9999, r character variable is nt in the range f 1 t 255. c) BASIC Errr Messages And Operatr Recvery 227

232

233 Errr Meaning Recvery 520 FORM statement PIC Ore string cntains a zer suppressin character after flating sign specified. 521 FORM statement PIC Ore r-",,( ) string cntains the same '-.../ leading and trailing signs. ('" ",--,) 522 FORM statement PIC Ore string cntains a trailing sign that is nt the last item in the string. 523 FORM statement PIC Ore string cntains invalid use f sign character. 524 FORM statement PIC OrG) string nt in range f 1 t 32 characters between parentheses. 525 FORM statement PIC rg) string cntains n digit specifiers r flating sign specificatin. ( 526 FORM statement Ore cntains character ther than B r trailing sign after the expnent specifier. 527 Insufficient strage t e syntax-check the statement. 528 Available strage e exceeded. C\ 0 _--, " 'I 550 Invalid cmmand syntax e r syntax errr in a DEL (delete) statement. BASIC Errr Messages And Operatr Recvery _.._._-_...,, "'--_..._

234 Errr Meaning Recvery 551 Invalid use f a e / " cmmand: 1. N place t g t n GO. 2. N statements t renumber. 3. N prgram t RUN. /' ~,., 4. N statements t LIST. 5. Prgram is lcked. 552 Unable t lcate line e number r next lwer line number fr a LIST.cmmand. 553 Functin key nt laded e r nt defined fr request. 554 Next line generated by Aut numbering is terminated, AUTO cmmand wuld enter line numbers via the exceed 9999 r attempt keybard. t lad a data file with mre than 9999 data \,....,.,. lines. 555 RENUM will cause a line e number greater than Statement number e referenced in a BASIC statement nt fund during RENUM. The statement number f the referring statement is displayed after the errr ( --, number. \... /' (r-"-'''- 230

235 ..... _._... _._ '- --_... _ C) C) /,' Errr Meaning Recvery 557 One f the fllwing has e ccurred: UTI L was specified t tape with an pen file. Device cde 0, 1, 2, 3, r 4 was specified n a LOAD, SAVE, r OPEN [FILE] cmmand. Input has been requested fr an utput nly device, r utput has been requested fr an input nly device. 558 End f file ccurred Specify a larger file and reenter befre cmpletin f a the SAVE cmmand. SAVE cmmand, SAVE is terminated. 559 Input line n LOAD e r scrll up the line and ignre SOURCE cmmand it. exceeds 64 bytes. ~-) 560 One f the fllwing has CD ccurred: C'"! The file type is incrrect fr a LOAD. The file type fr a MERGE is nt 11 when the wrk area is BASIC, r the file type is nt 2 when the wrk area is DATA. The file type is../ incrrect fr a LINK. 561 Data file with line lnger System limit, n recvery. than 330 bytes cannt be laded. ('\ 562 PROC cmmand issued ~) fr a file that is nt recrd I/O. " c BASIC Errr Messages And Operatr Recvery 231

236 Errr Meaning Recvery 563 Prcedure file recrd 0 ~-" length exceeds 64 bytes. 564 Invalid cmmand 0 becaus,e prcedure file is nt active. 565 Invalid value t skip n Crrect the value in the prcedure /' SKIP r CSKIP, the file. prcedure is terminated; "'". 566 MARK cmmand issued Enter GO in psitins 1 and 2 t fr a file already marked. cntinue r enter any ther character t end the MARK peratin. 567 MARK cmmand errr: Infrmatin nly, n recvery. ~. Fr tape, reached the end f the reel befre MARK cmpleted.. Fr diskette, reached end f the diskette befre MARK cmpleted. Fr tape, the last marked file and K-bytes allcated t the file are displayed. Fr diskette, the number f files a licated t the specified size are displayed. 568 File number already exits e n anther file. 569 On a SAVE cmmand, e the surce line is greater than the RECl specified. 600 Attempt t OPEN an e pen file. 601 OPEN [FI le] specifies a 0 file reference (FLO thrugh Fl9) fr a file that is already pen. ",,-"'~ ( " C---" "--.--' (_.--- I '" 602 OPEN FilE with a KEY 0 r~' specified when a master I \., file is nt currently pen. c 232

237 ----_......_.._...._ (~:) C). ~. I' ~j' C) c-' -) Errr Meaning Recvery 603 Attempting t pen mre 0 than ne file at a time! n tape r ther single file device. 604 Insufficient strage fr OrG) file OPEN request. See Recrd I/O File Buffer Requirements. 605 Invalid diskette label OrG) fund. 606 Unsupprted diskette OrG) label entries fund. 607 Attempting t pen a OrG) passwrd prtected tape file fr utput. 608 File type n the file IS OrG) nt valid fr input. 609 One f the fllwing has 0 ccurred: OPEN FILE specified 't device 000 r 001. OPEN specified t device 002. OPEN [FILE] specified t device '003' thrugh 'OOF 610 Invalid file ID r a OrG) cmplex name was specified fr a BASIC exchange file. 611 OPEN fr utput t OrG) write-prtected file r a file with a nnblank expiratin date. 613 Invalid device cde OrG) specified (ther than 0-9 r A-F). BASIC Errr Messages And Operatr Recvery 233

238 Errr Meaning Recvery 614 File name fund but nt OrG) r-" at file number specified, r file fund by number, but the header 10 and user I 0 d nt match. 615 Maximum lgical recrds OrG) ".-' '. n a file is greater than 2** NOBLOCK specified and OrG) lgical recrd size exceeds physical recrd size. 617 RECl= specifies a zer OrG) value. 618 Recrd length n recrd OrG) I/O file is O. 619 OPEN specified utput t rg) a file that is nt empty and the file 10 des nt match the loin the header specified. 621 I nsufficient strage t G) verify that crrect media /'-", is inserted. 1\ '--- -,..-"" 622 Device nt valid fr KEY G) file. 623 Invalid KEY parameter: e KP exceeds 64K, Kl exceeds 28, r KW exceeds 64K. '624 File specified fr KEY is G) nt direct. 625 Key length plus key G) psitin exceeds master recrd length. \" 626 Master file nt same G) access methd as index file. \ Strage exceeded G) allcating key infrmatin (~ "- blck. 234

239 0 Errr Meaning Recvery 628 Key length exceeds 28 CD psitins. 629 Invalid index file CD specified. ( ') 630 System errr. If errr cntinues t ccur, call yur service representative. '-_/ 631 Invalid key specified (first CD byte is X'OO' r X'FF). ( ;1... _---' 632 Recrd in master file CD (indicated by index file) des nt have matching key. 633 REWRITE t indexed file CD has mdified the key field (recrd nt written). 634 Cnversin errr CD detected. 635 DUPKEY errr detected. CD 636 NOKEY errr detected. CD 637 NOREC cnditin fund. CD 638 KEY specified n CD unindexed file, r REC (... specified n indexed file. CI 639 DELETE FILE specifies CD file that is nt indexed, recrd, r ALL 640 RESET specifies KEY t G) nnindexed file. 641 RESET with KEY CD specifies utput-nly file. 642 RESET FILE references CD stream I/O file, r RESET references recrd file. 643 ALL r REC= specified CD r enter GO line number t n a file created fr cntinue. REC= will be accepted sequential access. n further references t the file; r-'\ hwever, incrrect results can ccur if the file cntains a bad / sectr. e 645 I/O access t unpened CD file, r DELETE FILE specifies unpen file. BASIC Errr Messages And Operatr Recvery 235

240 Errr Meaning Recvery 646 One f the fllwing has e ccurred: The file referenced is nt pen. A GET r PUT referred t a recrd file. A READ r a WRITE FI LE referred t a stream file. A GET r READ FILE referred t an utput file. A PUT r WRITE FILE referred t an input file. PRI NT referred t an input, recrd, r stream input file. 647 An I/O peratin was e,.---~ attempted during evaluatin f a functin referenced in an input r utput statement. 648 REWRITE des nt CD fllw a READ r REREAD t a specified file. 649 REREAD des nt fllw e a READ r REREAD statement.,/""-- ~"". / r... ~"" ' (, 650 Statement 'specified in CD ( USING parameter is nt \'" a FORM r image statement. 651 PRINT USING specifies a e data item and there is n cnversin specificatin in the image statement. "'-- ("--~" /"--" ( \_.", 236

241 _._.--_.-._.. _ _... _--._ C\ C) 660 C"\ Errr Meaning Recvery 652 Statement specified in e EXIT parameter is nt an exit statement. 653 T few DATA e statements fr the READ statements issued. USE statement lcated e after the first data reference. 661 DIM statement cntains e previusly defined data..j 662 Invalid redimensin e specified (zer r exceeds 9999). 663 New array dimensins e exceed riginal allcatin. 664 MAT statement specifies e an array nt previusly defined. 665 I NV argument is singular. e 666 ION functin specified e fr a nnsquare matrix. ( ~./ 667 Operand dimensins are e C 0 C: invalid fr the functin used and the specified result array. 668 A referenced statement e number cannt be fund. 669 N FNEND statement e fund fr a DEF statement. 670 N matching NEXT e statement fund fr a FO R, r the cntrl variable did nt match. 671 NEXT statement e executed befre the matching FOR statement. 672 A RETURN withut a e value has been encuntered while n GOSUB is active. BASIC Err?r Messages And Operatr Recvery 237

242 Errr Meaning Recvery 673 A RETURN with a value e /'"""'" has been encuntered while n user functin is active. 674 CHAIN t prcedure file: e cmmand is t lng. " 680 Data underflw has Enter GO r GO statement number t ccurred (zer is cntinue r GO END t terminate assumed). 681 Data verflw has Enter GO r GO statement number t ccurred (plus r minus cntinue Qr GO END t terminate,,' 7.237E75 is assumed). ( 700 T many subscripts e used fr an array reference. 701 Subscript nt in range f e specified dimensins (t large r negative). 702 Reference fund t a e user-defined functin that is undefined fr this prgram. 703 Incrrect data type e (" returned fr this user-defined functin. 704 Incrrect number f e parameters specified in a user-defined functin reference. 705 System errr. Retry the peratin. If the errr recurs, call yur service representative. 706 Nnsquare matrix,fr e 707 DET functin. Argument fr LOG is negative. e (' 708 Invalid argument t EXP e functin (t large). 709 Argument fr square rt e (:-~ is negative. \ "- '\.,-"" 238

243 ._ _..._......_ _.._-_..._..._-_. _..._ Errr Meaning Recvery 710 Argument fr arcsine r e 1\ arccsine is greater than <.// Pwer functin attempt e t raise 0 t 0 pwer, r C~'\ C.,) attempt t raise 0 t a negative pwer. 712 Pwer functin attempt e C _) 713 t raise a negative number t a nninteger pwer. Invalid character string fund in NUM intrinsic e functin r errr in LEN functin. 714 File reference in KLN, e KPa rrln ~ntfl~ FLS, r FLO- FL Parameters fr STR are e zer r exceed the first argument length. (_/1 e'l,. 716 Strage exceeded trying e t allcate space fr a variable. 717 Insufficient wrk area t e calculate determinant. 718 Errr during e cncatenatin (t lng). 719 Operatr stack, perand e stack, r temp stack has verflwed. Statement is t lng, r there are t many nested functin calls. BASIC Errr Messages And Operatr Recvery 239

244 24b

245 _-_.. _._... _._.. -_.... Appendix E. Attaching a TV Mnitr c- ) ~.-' Generally, mdifying a standard TV set and using it as a vide mnitr yields less satisfactry results than a regular vide mnitr. This is because the same level f quality is nt built int TV receivers as is fund in mnitr class units. Fr example, the cntrast and reslutin are nt as gd n a mdified TV receiver; thus the image is nt as sharp and usually mre difficult t read. Hwever, if yu chse t mdify a TV receiver and use it as a vide mnitr yu must bserve the fllwing r yu may damage the?11 0 and expse yurself t a severe electric shck when yu attempt t hk up the TV set t the IBM A mdified TV set must have islatin between the primary line vltage and the set's chassis and circuitry. Yu can usually accmplish this by using an islatin transfrmer between yur utlet line vltage and the input vltage t the TV set. This transfrmer shuld be permanently wired int the circuit. The new input pwer plug must be a three-prng grunded plug with the grund cnnected t the chassis f the TV set. This grunding circuit must be electrically cnnected t the 5110 grunding circuit. Befre the vide input is cnnected t anything, it shuld be tested t verify that the cnnectr's external shell is at grund ptential and that n line vltage is present n either the external shell r the center cnductr. It.is the respnsibility f the TV mdifier t ensure that the input circuit meets the requirements f the 5110 utput and will nt damage the Three -prng Grunded Plug Islatin Transfrmer Output Cnnectr Nte: If yu d elect t mdify a TV receiver fr use as a vide mnitr, IBM accepts n respnsibility fr safety precautins during cnversin and hkup, fr damages incurred t the TV receiver r 5110, r fr the quality f the TV receiver as a vide mnitr. C -~)./ Attaching a TV Mnitr 241

246 '"-..., \.,r- - ( \ '

247 Index () (, "-.,,/ C " ) C:.) I (blb) character I 73, 155 & 73 &ERR &LINE &REC # ,135 59, access direct 75 key indexed 75 sequential 74 access methds 74 access the last recrd read 166 add recrds t a recrd I/O file 177 add tw matrices 183 additin 68 adjust cpy cntrl dial 217 AIDX 195 ALERT cmmand 16 alphabetic characters.. 53 AND 127 arithmetic arrays 63 arithmetic cnstants 58 arithmetic data 55 arithmetic expressins 67 arithmetic hierarachy 69 arithmetic peratrs 67 arithmetic values 57 arithmetic variables 59 array 178 array expressins 67, 73, 178 array size, specifying 100 arrays 61 ascending index 195 assign a scalar value 179 assign an array 181 assign values frm stream I/O file 122 assign values t variables 132 assigning file write prtectin n diskette 51 ATTN 7 audible alarm cntrl 79 AUTO cmmand 17 autmatic line numbering 17 backspace key 8 BASIC characters 209 BASI C errr messages 223 BASI C statements 87 blanks 54 buffer requirements 78 buffer space 78 buffers diskette 160 print 150 tape 160 CHAIN statement 90 changing a diskette vlume changing default address 52 character arrays 64 character cnstants 60 character data 59 character expressins 70 character mde lwercase 80 standard 80 character set, select 79 character variables 60 characteristics, printer 213 clear wrk space 25 CLOSE statement 92 CMD key 7 cmbine characters 71 cmma 157 cmma separatrs 74 cmmand keywrds 13 cmmands 13 cmments 167 cmmnly used peratins 65 cmmunative 68 cmplex file names 14 cncatenatin 72 cnsle indicatrs 9 cnsle switches 9 cnversin f data reference values 154 cpy cntrl dial 217 cpy display 8 CRC errrs 32 creating an internal data table 93 CSKIP cmmand 19 cursr, psitining 177 custmer supprt functins, LI N K 22 data cnstants 53 data files 74 data files, keybard generated 28 DATA statement 93 data table pinter 162, 170 declaring arrays 62 DE F statement 96 default address 14 default address, changing 52 defective cylinders 201 defining a functin 95 DEL functin 10 DELETE FI LE statement 99 delete key grup statements 30 delete key grups 30 Index 243

248 delete prgram lines 10 descending index 196 desk calculatr peratins 88 device address parameter 14 DIDX 196 digit specifier 110, 117 DIM statement 100 direct access 75 directry, file infrmatin 44 diskette defective cylinders handling and care insertin 201 remval 201 srt feature 52 strage 206 display a prgram 23 display screen 2 display screen cntrl display values n screen divisin 68 DROP a file E-frmat 154 EBCDIC characters 209 EBCDIC vajue 73 edit a saved data file 28 edit prgram lines 10 editing input lines 10 end prcessing 20 END statement 102 entry f a functin 27 errr messages 223 errr trapping 135 errrs, gruping in ne statement 103 executable statements 87 EXECUTE key 7 EXIT statement 103 expnent specifier 112, 119 expnentiatin 68 expressins 67 arrays 67, 73 character 70 relatinal 67, 72 scalar 67 extract characters 71 F-frmat 154 file directry 44 file FLS 79 file reference parameter 14 file size 32 file type file types 47 fixed-length data 74 fixed-pint frmat 56 flating-pint frmat 57 FLS 79 FNEND statement 95,105 FOR statement 106 FORM statement 108,153 frmat 153 frmat fr utput, specifying 108 frmat specificatin 154, 155 frmats fr printing r displaying 145 frward space key 8 FREE file space 50 full print znes 144 functin definitin 95 functin keys 28 functin, string 71 functin, substring 71 GET statement 122 GO cmmand 20 GO END cmmand 20 GO RUN 21 GO STEP 21 GO TRACE 21 GOSUB statement 124 GOTO statement 126 gruping errrs 103 hexadecimal representatin 209,221 hierarachy 69 HOLD key 7 I-frmat 154 identity matrix 189 IDN 189 I F statement 127 image statement 129, 153 IMFS 42 implied peratins 67 index an array 195,196 index file frmat 77 indexed file 75 indicatrs, cnsle 9 initialize files 31 input line 2 INPUT statement 130 Insert frms 214 insertin characters 111, 118 integer 56 internal cnstants 58 internal data table 162 internal data table, creating 93 internal variables 59 INV 191 inverse 191 invking cmmands 28 invking prgrams 28 (--~' '", 244

249 ......_.."'--"......_._ _._---_.._... ".._..".. _._..._ _ ".._..._"... c\ join character strings 72 key 75 key grup 29 key grup headers 29 key indexed access 75 key indexed file 164 key length 77 key recrds 77 keybard 3 keybard and cnsle lcatins 1 keybard generated data files 28 keybard layut 6 keywrds 5 keywrds, cmmands 13 MAT PRINT USING statement 153 MAT PUT statement 160 MAT READ FILE statement 164 MAT READ statement 162 MAT REREAD FILE statement 166 MAT REWRITE FILE statement 172 MAT WRITE FILE statement 177 matrix 73, 178 matrix inverse 191 matrix multiplicatin 185 matrix peratins 178 matrix transpse 193 maximum number f statements 87 MERG E cmmand 33 multiline functin 96 multiplicatin 68 multiply a matrix by a scalar 187 C '\./ CJ LET statement 132 line numbering, autmatic line-psitin pinter, display LINK cmmand 22 LIST cmmand 23 listing a file directry 45 lad a saved prgram 27 LOAD cmmand LOADO cmmand 25 lcatins, keybard and cnsle lck a saved prgram 41 lgical AND 127 lgical AND/OR 73 lgical 0 R 127 lgical recrd number 75 lng precisin 200 lp 106 lw-rder runding 68 lwercase character mde 3, 80 magnitude 55 MARK cmmand 31 marker recrds 77 MAT assignment additin and subtractin 183 ascending index 195 descending index 196 identity functin 189 inverse functin 191 matrix multiplicatin 185 scalar multiplicatin 187 scalar value 179 simple 181 statements 178 transpse functin 193 naming cnventins 64 natinal character sets 83 natinal graphics cntrl 79,83 negative peratrs 68 NEXT statement 106,134 nnexecutable statements 87 ONERROR statement 135 OPEN FILE statement 137 OPEN statement 137 pening a key-indexed file 141 perand 69 peratins, implied 67 peratr recvery 223 peratrs 67 arithmetic 67 psitive/negative 68 OR 127 verview 1 wner P= 0 40 packed print znes 145 pass data between prgrams 175 PAUSE statement 142 pinter 162,170 psitin the cursr 177 psitive peratrs 68 precisin 55 lng 200 shrt 200 prepare fr keybard entry f data 27 print a prgram 23 print buffer 150 PRINT statement 143 PRINT USING statement 153 print znes 144 printer characteristics 213 printer spacing cntrl 80 Index 245

250 printer stacker 220 printing/displaying with FORM 112 pririty level 69 PROe cmmand 35,84,90 prcedure file 35,84 prcedure file example 84 PROTECT a file 51 prtectin indicatr 49 PUT statement 160 RD = 21 R D = cmmand 36 RD = N, with RUN cmmand 40 RD = value 161 re-mark a file 31 READ FILE statement 164 read frm a recrd I/O file 164 READ statement 162 recrd frmatting with FORM 114,120 recrd I/O 74 recrd I/O file 164 recrd number 75 redimensining arrays 63 relatinal expressins 67, 72 relatinal peratr 72 relative recrd number 75 REM statement 167 remarks 167 remving file write prtectin 51 renaming a file n diskette 48 RENUM cmmand 37 replace a ribbn 217 replace characters 71 repsitin the input file 168 REREAD FI LE statement 166 RESET FILE statement. 168 RESET statement 168 RESTORE statement 170 resume prcessing 20 RETURN statement 95,124,171 REWIND cmmand 38 REWRITE FILE statement 172 runding 36 runding cntrl 80 rules, frmat specificatin 155 RUN cmmand 39 SAV E cmmand 41 scalar expressins 67 scrll dwn key 8 scrll up key 8 search argument 76 selecting diskette srt 52 semicln 157 semicln delimiter 145 sequential access 74 shift key 7 shrt precisin 200 simple,file names 14 single line functin 95 size required fr file 32 SKIP cmmand 43 skip recrds, cnditinally 19 spacing f displayed values 144 spacing f printed values 144 special characters 54 special keys 7 specifying array size 100 standard BASIC character mde 3,80 start executin f a prgram 39 statement CHAIN 90 CLOSE 92 DATA 93 DEF 95 DELETE FILE 99 DIM 100 END 102 EXIT 103 FN END 95, 105 FOR 106 FORM 108,153' GET 122 GOSUB 124 GOTO 126 IF 127 image 129, 153 INPUT 130 LET 132 MAT PRINT USING 153 MAT PUT 160 MAT READ 162 MAT READ FILE 164 MAT REREAD FILE 166 MAT REWRITE FILE 172 MAT WRITE FILE 177 NEXT 106,134 OPEN 137 OPEN FILE 137 PAUSE 142 PRINT 143 PR INT USING 153 PUT 160 READ 162 READ FILE 164 REM 167 REREAD FILE 166 RESET 168 RESET FILE 168 RESTORE 170 RETURN 95,124,171 REWRITE FILE 172,172 STOP 174 USE 90,175 WRITE FILE 177 statement lines 87 statement number 87 statement number range 87 statements, MAT assignment 178 step 20,39 \. 246

251 ._ _..".-...,,_.. "-,,."--...,,... 'stp prgram executin STOP statement 174' strage capacity 11 strage cnsideratins STR functin 71 stream I/O 74,92 stream I/O file 160 string functin 71 subexpressin 69 subrutines 171 substring functin 71 subtract tw matrices subtractin 68 switches, cnsle 9 syntax 15 system cmmands 13 system functins TAB functin 150 tape cartridge handling and care 199 terminate prgram executin 174 trace 20,39 trace peratin cntrl 80 transfer prgram cntrl 126 transfer prgram cntrl n results 127 transpse 193 TRN 193 TV mnitr 241 type 2 file 165 underscre character 55 update a recrd I/O file 172 USE statement 90,175 UTIL cmmand 44 UTI L cmmand, example 46 variable-length data 74 variables, internal 59 vectr 73 vlume ID 49 wrk area, saving 41 wrkarea buffer 78 WRITE FILE statement write t a stream I/O file write-prtecting a file n diskette hexadecimal representatins printer printer stacker BASIC characters BASIC cmpatibility hexadecimal representatins verview 1 CJ Index 247

252 248

253 r"" I \ I \"----'/ ('1 I I \, '---/ c READER'S (~:.(~) COMMENT FORM Please use this frm nly t identify publicatin errrs r request changes t publicatins. Technical questins abut IBM systems, changes in IBM prgramming supprt, requests fr additinal publicatins, etc, shuld be directed t yur IBM representative r t the IBM branch ffice nearest yur lcatin. Errr in publicatin (typgraphical, illustratin, and s n). N reply. Page Number Errr Inaccurate r misleading infrmatin in this publicatin. Please tell us abut it by using this pstage-paid frm. We will crrect r clarify the publicatin, r tell yu why a change is nt being made, prvided yu include yur name and address. Page Number Cmment (', -.-/ C \ ) J t»t ~s: nul :D~ (I) 0 W (I) ::::I n (I) s: Q) ::::I c: ~ Nte: All cmments and suggestins becme the prperty f IBM. N pstaga necessary if mailed in the U.S.A. Name Address C/J» t-l -' cd w c 6

254 SA Fld BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES POSTAGE WILL BE PAID BY IBM Crpratin General Systems Divisin Develpment Labratry Publicatins, Dept. 245 Rchester, Minnesta Fld FIRST CLASS PERMIT NO. 40 ARMONK, N. Y. I I I I I I I- I ~(.." U'I, I ~ '",.' ttl I~ I~ ~ I (1) ~ Q s: III :l C ~ Fld Fld _ Internatinal Business Machines Crpratin General Systems Divisin 4111 Nrthside Parkway N.W. P.O. Bx 2150 Atlanta, Gergia (U.S.A. nly) General Business Grup/Internatinal 44 Suth Bradway White Plains, New Yrk U.S.A. (Internatinal) ~.'" '\.. ~...

255

CS1150 Principles of Computer Science Midterm Review

CS1150 Principles of Computer Science Midterm Review CS1150 Principles f Cmputer Science Midterm Review Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Office hurs 10/15, Mnday, 12:05 12:50pm 10/17, Wednesday

More information

Adverse Action Letters

Adverse Action Letters Adverse Actin Letters Setup and Usage Instructins The FRS Adverse Actin Letter mdule was designed t prvide yu with a very elabrate and sphisticated slutin t help autmate and handle all f yur Adverse Actin

More information

Using the Swiftpage Connect List Manager

Using the Swiftpage Connect List Manager Quick Start Guide T: Using the Swiftpage Cnnect List Manager The Swiftpage Cnnect List Manager can be used t imprt yur cntacts, mdify cntact infrmatin, create grups ut f thse cntacts, filter yur cntacts

More information

Relius Documents ASP Checklist Entry

Relius Documents ASP Checklist Entry Relius Dcuments ASP Checklist Entry Overview Checklist Entry is the main data entry interface fr the Relius Dcuments ASP system. The data that is cllected within this prgram is used primarily t build dcuments,

More information

INSTALLING CCRQINVOICE

INSTALLING CCRQINVOICE INSTALLING CCRQINVOICE Thank yu fr selecting CCRQInvice. This dcument prvides a quick review f hw t install CCRQInvice. Detailed instructins can be fund in the prgram manual. While this may seem like a

More information

Using the Swiftpage Connect List Manager

Using the Swiftpage Connect List Manager Quick Start Guide T: Using the Swiftpage Cnnect List Manager The Swiftpage Cnnect List Manager can be used t imprt yur cntacts, mdify cntact infrmatin, create grups ut f thse cntacts, filter yur cntacts

More information

Project #1 - Fraction Calculator

Project #1 - Fraction Calculator AP Cmputer Science Liberty High Schl Prject #1 - Fractin Calculatr Students will implement a basic calculatr that handles fractins. 1. Required Behavir and Grading Scheme (100 pints ttal) Criteria Pints

More information

RxAXIS Security Module 09/25/2013

RxAXIS Security Module 09/25/2013 RxAXIS Security Mdule 09/25/2013 Lessn Title Intrductin: Security Mdule In this tutrial we are ging t lk at the Security Maintenance Mdule f the RxAXIS system. When used, this system gives emplyees access

More information

TaiRox Mail Merge. Running Mail Merge

TaiRox Mail Merge. Running Mail Merge TaiRx Mail Merge TaiRx Mail Merge TaiRx Mail Merge integrates Sage 300 with Micrsft Wrd s mail merge functin. The integratin presents a Sage 300 style interface frm within the Sage 300 desktp. Mail Merge

More information

What s New in Banner 9 Admin Pages: Differences from Banner 8 INB Forms

What s New in Banner 9 Admin Pages: Differences from Banner 8 INB Forms 1 What s New in Banner 9 Admin Pages: Differences frm Banner 8 INB Frms Majr Changes: Banner gt a face-lift! Yur hme page is called Applicatin Navigatr and is the entry/launch pint t all pages Banner is

More information

These tasks can now be performed by a special program called FTP clients.

These tasks can now be performed by a special program called FTP clients. FTP Cmmander FAQ: Intrductin FTP (File Transfer Prtcl) was first used in Unix systems a lng time ag t cpy and mve shared files. With the develpment f the Internet, FTP became widely used t uplad and dwnlad

More information

CS1150 Principles of Computer Science Introduction (Part II)

CS1150 Principles of Computer Science Introduction (Part II) Principles f Cmputer Science Intrductin (Part II) Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Review Terminlgy Class } Every Java prgram must have at least

More information

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 1 - Calculatr Intrductin In this lab yu will be writing yur first

More information

TRAINING GUIDE. Lucity Mobile

TRAINING GUIDE. Lucity Mobile TRAINING GUIDE The Lucity mbile app gives users the pwer f the Lucity tls while in the field. They can lkup asset infrmatin, review and create wrk rders, create inspectins, and many mre things. This manual

More information

GTS Webbooking (GTSVE093)

GTS Webbooking (GTSVE093) GTS Webbking (GTSVE093) User manual - April 2016 Updatet: April 2016 Page : 2 f 16 Cntents 1 Intrductin 3 2 Instructins 4 2.1 General 4 2.2 Changing the custmer number 4 2.3 Types f bking 4 2.4 Draft 4

More information

* The mode WheelWork starts in can be changed using command line options.

* The mode WheelWork starts in can be changed using command line options. OperatiOns Manual Overview Yur muse mst likely has a wheel n it. If yu lk at yur muse frm the side, that wheel rtates clckwise and cunterclckwise, like a knb. If yu lk at the muse frm the tp, the wheel

More information

Eastern Mediterranean University School of Computing and Technology Information Technology Lecture2 Functions

Eastern Mediterranean University School of Computing and Technology Information Technology Lecture2 Functions Eastern Mediterranean University Schl f Cmputing and Technlgy Infrmatin Technlgy Lecture2 Functins User Defined Functins Why d we need functins? T make yur prgram readable and rganized T reduce repeated

More information

Procurement Contract Portal. User Guide

Procurement Contract Portal. User Guide Prcurement Cntract Prtal User Guide Cntents Intrductin...2 Access the Prtal...2 Hme Page...2 End User My Cntracts...2 Buttns, Icns, and the Actin Bar...3 Create a New Cntract Request...5 Requester Infrmatin...5

More information

Web of Science Institutional authored and cited papers

Web of Science Institutional authored and cited papers Web f Science Institutinal authred and cited papers Prcedures written by Diane Carrll Washingtn State University Libraries December, 2007, updated Nvember 2009 Annual review f paper s authred and cited

More information

DUO LINK 4 APP User Manual V- A PNY Technologies, Inc. 1. PNY Technologies, Inc. 34.

DUO LINK 4 APP User Manual V- A PNY Technologies, Inc. 1. PNY Technologies, Inc. 34. 34. 1. Table f Cntents Page 1. Prduct Descriptin 4 2. System Requirements 5 3. DUO LINK App Installatin 5 4. DUO LINK App Mving Screens 7 5. File Management 5.1. Types f views 8 5.2. Select Files t Cpy,

More information

What is "Click to DVD"? Capabilities. Click to DVD software enables you to easily create your own DVDs.

What is Click to DVD? Capabilities. Click to DVD software enables you to easily create your own DVDs. What is "Click t DVD"? Click t DVD sftware enables yu t easily create yur wn DVDs. Capabilities With Click t DVD, yu can capture vide cntent frm a digital vide device t create yur wn DVDs, cmplete with

More information

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 Iterative Code Design handout Style Guidelines handout

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 Iterative Code Design handout Style Guidelines handout UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2013 Lab 1 - Calculatr Intrductin Reading Cncepts In this lab yu will be

More information

Uploading Files with Multiple Loans

Uploading Files with Multiple Loans Uplading Files with Multiple Lans Descriptin & Purpse Reprting Methds References Per the MHA Handbk, servicers are required t prvide peridic lan level data fr activity related t the Making Hme Affrdable

More information

Quick Start Guide. Basic Concepts. DemoPad Designer - Quick Start Guide

Quick Start Guide. Basic Concepts. DemoPad Designer - Quick Start Guide Quick Start Guide This guide will explain the prcess f installing & using the DemPad Designer sftware fr PC, which allws yu t create a custmised Graphical User Interface (GUI) fr an iphne / ipad & embed

More information

Importing data. Import file format

Importing data. Import file format Imprting data The purpse f this guide is t walk yu thrugh all f the steps required t imprt data int CharityMaster. The system allws nly the imprtatin f demgraphic date e.g. names, addresses, phne numbers,

More information

Computer Organization and Architecture

Computer Organization and Architecture Campus de Gualtar 4710-057 Braga UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA Departament de Infrmática Cmputer Organizatin and Architecture 5th Editin, 2000 by William Stallings Table f Cntents I. OVERVIEW.

More information

Integrating QuickBooks with TimePro

Integrating QuickBooks with TimePro Integrating QuickBks with TimePr With TimePr s QuickBks Integratin Mdule, yu can imprt and exprt data between TimePr and QuickBks. Imprting Data frm QuickBks The TimePr QuickBks Imprt Facility allws data

More information

Access 2000 Queries Tips & Techniques

Access 2000 Queries Tips & Techniques Access 2000 Queries Tips & Techniques Query Basics The query is the basic tl that Access prvides fr retrieving infrmatin frm yur database. Each query functins like a questin that can be asked immediately

More information

STIDistrict AL Rollover Procedures

STIDistrict AL Rollover Procedures 2009-2010 STIDistrict AL Rllver Prcedures General Infrmatin abut STIDistrict Rllver IMPORTANT NOTE! Rllver shuld be perfrmed between June 25 and July 25 2010. During this perid, the STIState applicatin

More information

Constituent Page Upgrade Utility for Blackbaud CRM

Constituent Page Upgrade Utility for Blackbaud CRM Cnstituent Page Upgrade Utility fr Blackbaud CRM In versin 4.0, we made several enhancements and added new features t cnstituent pages. We replaced the cnstituent summary with interactive summary tiles.

More information

Overview of OPC Alarms and Events

Overview of OPC Alarms and Events Overview f OPC Alarms and Events Cpyright 2016 EXELE Infrmatin Systems, Inc. EXELE Infrmatin Systems (585) 385-9740 Web: http://www.exele.cm Supprt: supprt@exele.cm Sales: sales@exele.cm Table f Cntents

More information

Test Pilot User Guide

Test Pilot User Guide Test Pilt User Guide Adapted frm http://www.clearlearning.cm Accessing Assessments and Surveys Test Pilt assessments and surveys are designed t be delivered t anyne using a standard web brwser and thus

More information

ClassFlow Administrator User Guide

ClassFlow Administrator User Guide ClassFlw Administratr User Guide ClassFlw User Engagement Team April 2017 www.classflw.cm 1 Cntents Overview... 3 User Management... 3 Manual Entry via the User Management Page... 4 Creating Individual

More information

OASIS SUBMISSIONS FOR FLORIDA: SYSTEM FUNCTIONS

OASIS SUBMISSIONS FOR FLORIDA: SYSTEM FUNCTIONS OASIS SUBMISSIONS FOR FLORIDA: SYSTEM FUNCTIONS OASIS SYSTEM FUNCTIONS... 2 ESTABLISHING THE COMMUNICATION CONNECTION... 2 ACCESSING THE OASIS SYSTEM... 3 SUBMITTING OASIS DATA FILES... 5 OASIS INITIAL

More information

PaperStream Capture change history

PaperStream Capture change history PaperStream Capture change histry Versin 2.0.1 New features: 1. Ad hc scan is added, which allws yu t mdify sme f the settings (scanner setting, destinatin setting, etc.) extempre and scan withut changing

More information

Procedures for Developing Online Training

Procedures for Developing Online Training Prcedures fr Develping Online Training Fllwing are prcedures fr develping nline training mdules t be psted n Online@UT (Blackbard Learn). These steps were develped thrugh a prcess and will cntinue t be

More information

Lab 0: Compiling, Running, and Debugging

Lab 0: Compiling, Running, and Debugging UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 0: Cmpiling, Running, and Debugging Intrductin Reading This is the

More information

STIQuery Basics. A second example is included at the end of this document.

STIQuery Basics. A second example is included at the end of this document. STIQuery Basics Using STIQuery A wide variety f reprts may be generated via STIQuery. With this tl, the use can retrieve data frm different areas f the prgram and cmbine the infrmatin tgether in ne reprt.

More information

Proper Document Usage and Document Distribution. TIP! How to Use the Guide. Managing the News Page

Proper Document Usage and Document Distribution. TIP! How to Use the Guide. Managing the News Page Managing the News Page TABLE OF CONTENTS: The News Page Key Infrmatin Area fr Members... 2 Newsletter Articles... 3 Adding Newsletter as Individual Articles... 3 Adding a Newsletter Created Externally...

More information

Smart Arm Installation and Setup Guide

Smart Arm Installation and Setup Guide Smart Arm Installatin and Setup Guide PS1E, PS2E and PS150E Objective: The guideline is intended t detail the installatin and setup instructins fr the Smart Mtin Smart Arms systems, including the PS1E,

More information

What s New in version 3.04 November 2012

What s New in version 3.04 November 2012 What s New in versin 3.04 Nvember 2012 PrAdmin versin 3.04 intrduces the ability t validate the Database Linkage, a new Late Retirement Calculatin cmpnent, service and salary anniversary year measurement

More information

Interfacing to MATLAB. You can download the interface developed in this tutorial. It exists as a collection of 3 MATLAB files.

Interfacing to MATLAB. You can download the interface developed in this tutorial. It exists as a collection of 3 MATLAB files. Interfacing t MATLAB Overview: Getting Started Basic Tutrial Interfacing with OCX Installatin GUI with MATLAB's GUIDE First Buttn & Image Mre ActiveX Cntrls Exting the GUI Advanced Tutrial MATLAB Cntrls

More information

1 Getting and Extracting the Upgrader

1 Getting and Extracting the Upgrader Hughes BGAN-X 9202 Upgrader User Guide (Mac) Rev 1.0 (23-Feb-12) This dcument explains hw t use the Hughes BGAN Upgrader prgram fr the 9202 User Terminal using a Mac Nte: Mac OS X Versin 10.4 r newer is

More information

Re-Flashing Your CDM-760 Advanced High-Speed Trunking Modem

Re-Flashing Your CDM-760 Advanced High-Speed Trunking Modem Re-Flashing Yur CDM-760 Advanced High-Speed Trunking Mdem I. Intrductin: Firmware Files, Naming, Versins, and Frmats Make sure t perate the CDM-760 with its latest available firmware. Befre attempting

More information

The Reporting Tool. An Overview of HHAeXchange s Reporting Tool

The Reporting Tool. An Overview of HHAeXchange s Reporting Tool HHAeXchange The Reprting Tl An Overview f HHAeXchange s Reprting Tl Cpyright 2017 Hmecare Sftware Slutins, LLC One Curt Square 44th Flr Lng Island City, NY 11101 Phne: (718) 407-4633 Fax: (718) 679-9273

More information

Configuring Database & SQL Query Monitoring With Sentry-go Quick & Plus! monitors

Configuring Database & SQL Query Monitoring With Sentry-go Quick & Plus! monitors Cnfiguring Database & SQL Query Mnitring With Sentry-g Quick & Plus! mnitrs 3Ds (UK) Limited, Nvember, 2013 http://www.sentry-g.cm Be Practive, Nt Reactive! One f the best ways f ensuring a database is

More information

1 Getting and Extracting the Upgrader

1 Getting and Extracting the Upgrader Hughes BGAN-X 9211 Upgrader User Guide (Mac) Rev 1.2 (6-Jul-17) This dcument explains hw t use the Hughes BGAN Upgrader prgram fr the 9211 User Terminal using a Mac Nte: Mac OS X Versin 10.4 r newer is

More information

VMware Horizon Mirage Web Manager Guide v4.2

VMware Horizon Mirage Web Manager Guide v4.2 VMware Hrizn Mirage Web Manager Guide v4.2 June 2013 Cntents Overview... 3 Installatin Ntes... 3 Lgging In... 3 Perfrming a Quick Search... 4 Perfrming an Advanced Search... 5 Selecting a User-Device...

More information

MOS Access 2013 Quick Reference

MOS Access 2013 Quick Reference MOS Access 2013 Quick Reference Exam 77-424: MOS Access 2013 Objectives http://www.micrsft.cm/learning/en-us/exam.aspx?id=77-424 Create and Manage a Database Create a New Database This bjective may include

More information

Silent Messenger MegaTech Control Console

Silent Messenger MegaTech Control Console Silent Messenger MegaTech Cntrl Cnsle TRAFIX Operating System (Ver. 1.9.17) Menu Structure & Operating Instructins: SlarTech Splash Screen The SlarTech Splash Screen is presented at the cmpletin f system

More information

Chapter 2 Basic Operations

Chapter 2 Basic Operations Chapter 2 Basic Operatins Lessn B String Operatins 10 Minutes Lab Gals In this Lessn, yu will: Learn hw t use the fllwing Transfrmatins: Set Replace Extract Cuntpattern Split Learn hw t apply certain Transfrmatins

More information

TRAINING GUIDE. Overview of Lucity Spatial

TRAINING GUIDE. Overview of Lucity Spatial TRAINING GUIDE Overview f Lucity Spatial Overview f Lucity Spatial In this sessin, we ll cver the key cmpnents f Lucity Spatial. Table f Cntents Lucity Spatial... 2 Requirements... 2 Setup... 3 Assign

More information

UiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash

UiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash UiPath Autmatin Walkthrugh Walkthrugh Calculate Client Security Hash Walkthrugh Calculate Client Security Hash Start with the REFramewrk template. We start ff with a simple implementatin t demnstrate the

More information

BI Publisher TEMPLATE Tutorial

BI Publisher TEMPLATE Tutorial PepleSft Campus Slutins 9.0 BI Publisher TEMPLATE Tutrial Lessn T2 Create, Frmat and View a Simple Reprt Using an Existing Query with Real Data This tutrial assumes that yu have cmpleted BI Publisher Tutrial:

More information

AT&T Corporate Voice Mail Unified Messaging (CVM-UM) Quick Start

AT&T Corporate Voice Mail Unified Messaging (CVM-UM) Quick Start AT&T Crprate Vice Mail Unified Messaging (CVM-UM) Quick Start 2011 AT&T Intellectual Prperty. All rights reserved. AT&T the lg and all ther AT&T marks cntained herein are trademarks f AT&T Intellectual

More information

Xilinx Answer Xilinx PCI Express DMA Drivers and Software Guide

Xilinx Answer Xilinx PCI Express DMA Drivers and Software Guide Xilinx Answer 65444 Xilinx PCI Express DMA Drivers and Sftware Guide Imprtant Nte: This dwnladable PDF f an Answer Recrd is prvided t enhance its usability and readability. It is imprtant t nte that Answer

More information

The following screens show some of the extra features provided by the Extended Order Entry screen:

The following screens show some of the extra features provided by the Extended Order Entry screen: SmartFinder Orders Extended Order Entry Extended Order Entry is an enhanced replacement fr the Sage Order Entry screen. It prvides yu with mre functinality while entering an rder, and fast access t rder,

More information

About this Guide This Quick Reference Guide provides an overview of the query options available under Utilities Query menu in InformationNOW.

About this Guide This Quick Reference Guide provides an overview of the query options available under Utilities Query menu in InformationNOW. InfrmatinNOW Query Abut this Guide This Quick Reference Guide prvides an verview f the query ptins available under Utilities Query menu in InfrmatinNOW. Query Mdule The query mdule, fund under Utilities

More information

Controlpad 681. Fully Programmable 35-Key Serial or USB Virtual Serial Keypad. User Manual Revision 4.0 For Windows 95/98, NT 4.

Controlpad 681. Fully Programmable 35-Key Serial or USB Virtual Serial Keypad. User Manual Revision 4.0 For Windows 95/98, NT 4. 17741 MITCHELL NORTH, IRVINE CALIFORNIA 92614 USA PHONE: (949) 833-3355 FAX: (949) 833-0322 INTERNET: http://www.genvatin.cm Email: supprt@genvatin.cm Cntrlpad 681 Fully Prgrammable 35-Key Serial r USB

More information

Xerox WorkCentre 7120/7125 Series User Instructions

Xerox WorkCentre 7120/7125 Series User Instructions Xerx WrkCentre 7120/7125 Series User Instructins Hw t Make a Cpy Using the Duplex Autmatic Dcument Feeder (DADF) NOTE: Use the DADF fr multiple r single pages. Use the Dcument Glass fr single cpies r paper

More information

Ascii Art Capstone project in C

Ascii Art Capstone project in C Ascii Art Capstne prject in C CSSE 120 Intrductin t Sftware Develpment (Rbtics) Spring 2010-2011 Hw t begin the Ascii Art prject Page 1 Prceed as fllws, in the rder listed. 1. If yu have nt dne s already,

More information

E2Open Multi-Collab View (MCV)

E2Open Multi-Collab View (MCV) If yu can read this Click n the icn t chse a picture r Reset the slide. T Reset: Right click n the slide thumbnail and select reset slide r chse the Reset buttn n the Hme ribbn (next t the f nt chice bx)

More information

Lab 4. Name: Checked: Objectives:

Lab 4. Name: Checked: Objectives: Lab 4 Name: Checked: Objectives: Learn hw t test cde snippets interactively. Learn abut the Java API Practice using Randm, Math, and String methds and assrted ther methds frm the Java API Part A. Use jgrasp

More information

STUDIO DESIGNER. Design Projects Basic Participant

STUDIO DESIGNER. Design Projects Basic Participant Design Prjects Basic Participant Thank yu fr enrlling in Design Prjects 2 fr Studi Designer. Please feel free t ask questins as they arise. If we start running shrt n time, we may hld ff n sme f them and

More information

Element Creator for Enterprise Architect

Element Creator for Enterprise Architect Element Creatr User Guide Element Creatr fr Enterprise Architect Element Creatr fr Enterprise Architect... 1 Disclaimer... 2 Dependencies... 2 Overview... 2 Limitatins... 3 Installatin... 4 Verifying the

More information

3 AXIS STAGE CONTROLLER

3 AXIS STAGE CONTROLLER CORTEX CONTROLLERS 50, St Stephen s Pl. Cambridge CB3 0JE Telephne +44(0)1223 368000 Fax +44(0)1223 462800 http://www.crtexcntrllers.cm sales@crtexcntrllers.cm 3 AXIS STAGE CONTROLLER Instructin Manual

More information

Gemini Intercom Quick Start Guide

Gemini Intercom Quick Start Guide Gemini Intercm Quick Start Guide 2 Quick Start Guide Cntents Cntents... 1 Overview... 3 First Step unpack and inspect... 3 Netwrk plan and IP addresses... 4 Management PC... 5 Install Sftware... 6 Cnfigure

More information

Scroll down to New and another menu will appear. Select Folder and a new

Scroll down to New and another menu will appear. Select Folder and a new Creating a New Flder Befre we begin with Micrsft Wrd, create a flder n yur Desktp named Summer PD. T d this, right click anywhere n yur Desktp and a menu will appear. Scrll dwn t New and anther menu will

More information

State Assessment Program Indiana Released Items Repository Quick Guide

State Assessment Program Indiana Released Items Repository Quick Guide State Assessment Prgram Indiana Released Items Repsitry Quick Guide 2018 2019 Published December 10, 2018 Prepared by the American Institutes fr Research Released Items Repsitry Intrductin This guide prvides

More information

Creating Relativity Dynamic Objects

Creating Relativity Dynamic Objects Creating Relativity Dynamic Objects Nvember 28, 2017 - Versin 9.4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

More information

Avaya 9610 IP Telephone End User Guide

Avaya 9610 IP Telephone End User Guide Avaya 9610 IP Telephne End User Guide 9610 IP Telephne End User Guide 1 P age Table f Cntents Abut Yur Telephne... 3 Abut Scrlling and Navigatin... 3 Selecting Names, Numbers, r Features... 3 Starting

More information

Microsoft Excel Extensions for Enterprise Architect

Microsoft Excel Extensions for Enterprise Architect Excel Extensins User Guide Micrsft Excel Extensins fr Enterprise Architect Micrsft Excel Extensins fr Enterprise Architect... 1 Disclaimer... 2 Dependencies... 2 Overview... 2 Installatin... 4 Verifying

More information

SmartPass User Guide Page 1 of 50

SmartPass User Guide Page 1 of 50 SmartPass User Guide Table f Cntents Table f Cntents... 2 1. Intrductin... 3 2. Register t SmartPass... 4 2.1 Citizen/Resident registratin... 4 2.1.1 Prerequisites fr Citizen/Resident registratin... 4

More information

RISKMAN REFERENCE GUIDE TO USER MANAGEMENT (Non-Network Logins)

RISKMAN REFERENCE GUIDE TO USER MANAGEMENT (Non-Network Logins) Intrductin This reference guide is aimed at managers wh will be respnsible fr managing users within RiskMan where RiskMan is nt cnfigured t use netwrk lgins. This guide is used in cnjunctin with the respective

More information

Online Image Viewing Agent User Guide. Texas FAIR Plan Association 1

Online Image Viewing Agent User Guide. Texas FAIR Plan Association 1 Online Image Viewing gent User Guide Texas FIR Plan ssciatin 1 Table f Cntents 1. Online Image Viewing... 4 2. Frequently sked uestins (F)... 15 TFP Online Image Viewing Guide 2 Table f Figures Figure

More information

USER MANUAL. RoomWizard Administrative Console

USER MANUAL. RoomWizard Administrative Console USER MANUAL RmWizard Administrative Cnsle Cntents Welcme... 3 Administer yur RmWizards frm ne lcatin... 3 Abut This Manual... 4 Setup f the Administrative Cnsle... 4 Installatin... 4 The Cnsle Windw...

More information

COP2800 Homework #3 Assignment Spring 2013

COP2800 Homework #3 Assignment Spring 2013 YOUR NAME: DATE: LAST FOUR DIGITS OF YOUR UF-ID: Please Print Clearly (Blck Letters) YOUR PARTNER S NAME: DATE: LAST FOUR DIGITS OF PARTNER S UF-ID: Please Print Clearly Date Assigned: 15 February 2013

More information

Dear Milestone Customer,

Dear Milestone Customer, Dear Milestne Custmer, With the purchase f Milestne Xprtect Transact yu have chsen a very flexible ptin t yur Milestne Xprtect Business slutin. Milestne Xprtect Transact enables yu t stre a serial data

More information

Smart Edit Manual. Page 1

Smart Edit Manual. Page 1 Smart Edit Manual Page 1 Table f Cntents Symbls... 7 User Interface... 8 Reddts at a Glance... 10 Page Search Panel... 11 First Steps in SmartEdit... 12 Opening the Start Page... 12 Editing Pages... 12

More information

Dashboard Extension for Enterprise Architect

Dashboard Extension for Enterprise Architect Dashbard Extensin fr Enterprise Architect Dashbard Extensin fr Enterprise Architect... 1 Disclaimer... 2 Dependencies... 2 Overview... 2 Limitatins f the free versin f the extensin... 3 Example Dashbard

More information

MySqlWorkbench Tutorial: Creating Related Database Tables

MySqlWorkbench Tutorial: Creating Related Database Tables MySqlWrkbench Tutrial: Creating Related Database Tables (Primary Keys, Freign Keys, Jining Data) Cntents 1. Overview 2 2. Befre Yu Start 2 3. Cnnect t MySql using MySqlWrkbench 2 4. Create Tables web_user

More information

Extended Vendors lets you: Maintain vendors across multiple Sage 300 companies using the Copy Vendors functionality. o

Extended Vendors lets you: Maintain vendors across multiple Sage 300 companies using the Copy Vendors functionality. o Extended Vendrs Extended Vendrs is an enhanced replacement fr the Sage Vendrs frm. It prvides yu with mre infrmatin while entering a PO and fast access t additinal PO, Vendr, and Item infrmatin. Extended

More information

Copyrights and Trademarks

Copyrights and Trademarks Cpyrights and Trademarks Sage One Accunting Cnversin Manual 1 Cpyrights and Trademarks Cpyrights and Trademarks Cpyrights and Trademarks Cpyright 2002-2014 by Us. We hereby acknwledge the cpyrights and

More information

ROCK-POND REPORTING 2.1

ROCK-POND REPORTING 2.1 ROCK-POND REPORTING 2.1 AUTO-SCHEDULER USER GUIDE Revised n 08/19/2014 OVERVIEW The purpse f this dcument is t describe the prcess in which t fllw t setup the Rck-Pnd Reprting prduct s that users can schedule

More information

MIPS Architecture and Assembly Language Overview

MIPS Architecture and Assembly Language Overview MIPS Architecture and Assembly Language Overview Adapted frm: http://edge.mcs.dre.g.el.edu/gicl/peple/sevy/architecture/mipsref(spim).html [Register Descriptin] [I/O Descriptin] Data Types and Literals

More information

- Replacement of a single statement with a sequence of statements(promotes regularity)

- Replacement of a single statement with a sequence of statements(promotes regularity) ALGOL - Java and C built using ALGOL 60 - Simple and cncise and elegance - Universal - Clse as pssible t mathematical ntatin - Language can describe the algrithms - Mechanically translatable t machine

More information

Studio One 3.5 Audio Dropout Protection and Low-Latency Monitoring

Studio One 3.5 Audio Dropout Protection and Low-Latency Monitoring Studi One 3.5 Audi Drput Prtectin and Lw-Latency Mnitring Handbk Jeff Pettit 5/23/2017 Revisin Histry: 1. Initial Release 5/23/2017 1.1. Added LLM plugins behind the scenes lgic and clean up 5/24/2017

More information

I. Introduction: About Firmware Files, Naming, Versions, and Formats

I. Introduction: About Firmware Files, Naming, Versions, and Formats I. Intrductin: Abut Firmware Files, Naming, Versins, and Frmats The UT-4500-A Series Upcnverters and DT-4500-A Series Dwncnverters stre their firmware in flash memry, which allws the system t uplad firmware

More information

Exercise 4: Working with tabular data Exploring infant mortality in the 1900s

Exercise 4: Working with tabular data Exploring infant mortality in the 1900s Exercise 4: Wrking with tabular data Explring infant mrtality in the 1900s Backgrund Althugh peple tend t think abut GIS as being primarily cncerned with mapping. It is better thught f as a type f database

More information

LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C

LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C Due: July 9 (Sun) 11:59 pm 1. Prblem A Subject: Structure declaratin, initializatin and assignment. Structure

More information

I. Introduction: About Firmware Files, Naming, Versions, and Formats

I. Introduction: About Firmware Files, Naming, Versions, and Formats Updating Yur CTOG 250 Cmtech Traffic Optimizatin Gateway Firmware I. Intrductin: Abut Firmware Files, Naming, Versins, and Frmats The CTOG 250 Cmtech Traffic Optimizatin Gateway and its CDM 800 Gateway

More information

$ARCSIGHT_HOME/current/user/agent/map. The files are named in sequential order such as:

$ARCSIGHT_HOME/current/user/agent/map. The files are named in sequential order such as: Lcatin f the map.x.prperties files $ARCSIGHT_HOME/current/user/agent/map File naming cnventin The files are named in sequential rder such as: Sme examples: 1. map.1.prperties 2. map.2.prperties 3. map.3.prperties

More information

Entering an NSERC CCV: Step by Step

Entering an NSERC CCV: Step by Step Entering an NSERC CCV: Step by Step - 2018 G t CCV Lgin Page Nte that usernames and passwrds frm ther NSERC sites wn t wrk n the CCV site. If this is yur first CCV, yu ll need t register: Click n Lgin,

More information

InformationNOW Elementary Scheduling

InformationNOW Elementary Scheduling InfrmatinNOW Elementary Scheduling Abut Elementary Scheduling Elementary scheduling is used in thse schls where grups f students remain tgether all day. Fr infrmatin regarding scheduling students using

More information

C++ Reference Material Programming Style Conventions

C++ Reference Material Programming Style Conventions C++ Reference Material Prgramming Style Cnventins What fllws here is a set f reasnably widely used C++ prgramming style cnventins. Whenever yu mve int a new prgramming envirnment, any cnventins yu have

More information

Studio Software Update 7.7 Release Notes

Studio Software Update 7.7 Release Notes Studi Sftware Update 7.7 Release Ntes Summary: Previus Studi Release: 2013.10.17/2015.01.07 All included Studi applicatins have been validated fr cmpatibility with previusly created Akrmetrix Studi file

More information

Arius 3.0. Release Notes and Installation Instructions. Milliman, Inc Peachtree Road, NE Suite 1900 Atlanta, GA USA

Arius 3.0. Release Notes and Installation Instructions. Milliman, Inc Peachtree Road, NE Suite 1900 Atlanta, GA USA Release Ntes and Installatin Instructins Milliman, Inc. 3424 Peachtree Rad, NE Suite 1900 Atlanta, GA 30326 USA Tel +1 800 404 2276 Fax +1 404 237 6984 actuarialsftware.cm 1. Release ntes Release 3.0 adds

More information

User Guide. ACE Data Source. OnCommand Workflow Automation (WFA) Abstract PROFESSIONAL SERVICES

User Guide. ACE Data Source. OnCommand Workflow Automation (WFA) Abstract PROFESSIONAL SERVICES PROFESSIONAL SERVICES User Guide OnCmmand Wrkflw Autmatin (WFA) ACE Data Surce Prepared fr: ACE Data Surce - Versin 2.0.0 Date: Octber 2015 Dcument Versin: 2.0.0 Abstract The ACE Data Surce (ACE-DS) is

More information

Working With Audacity

Working With Audacity Wrking With Audacity Audacity is a free, pen-surce audi editing prgram. The majr user interface elements are highlighted in the screensht f the prgram s main windw belw. The editing tls are used t edit

More information

The Login Page Designer

The Login Page Designer The Lgin Page Designer A new Lgin Page tab is nw available when yu g t Site Cnfiguratin. The purpse f the Admin Lgin Page is t give fundatin staff the pprtunity t build a custm, yet simple, layut fr their

More information