background image

Summary of Contents for 5100

Page 1: ..._ IBM 5100 BASIC Reference Manual o o It...

Page 2: ...and illustrations are indicated by a vertical line at the left of the change Changes are continually made to the specifications herein any such changes will be reported in subsequent revisions or tech...

Page 3: ...Line Buffer Operation 96 Alphabetic Characters 40 PRINT USING and Image 98 Numeric Characters 40 Conversion of Data Reference Values 99 Special Characters 41 Format Specifications 100 Use of Blanks 4...

Page 4: ...BASIC ERROR MESSAGES AND OPERATOR RECOVERY 149 APPENDIX C SETUP PROCEDURES 157 Environment 157 5100 Setup Procedure 157 IBM 5106 Auxiliary Tape Unit Setup Procedure 163 Cleaning the Tape Head 164 IBM...

Page 5: ...hts The dis play screen and indicator lights communicate information to the user and the keyboard and switches allow the user to control the operations the system will perform Figure 1 shows a combine...

Page 6: ...storage available to the user Line 1 input line contains information entered from the keyboard The cursor flashing horizontal line indicates where the next input from the keyboara will be displayed I...

Page 7: ...ugh they do not appear on the BASIC keyboard When any of the keys are pressed the characters entered appear in the input line on the display screen BASIC statement keywords are printed on the front of...

Page 8: ...key and pressing a key with a BASIC statement keyword on the front will enter the keyword beginning at the current position of the cursor When you press EXECUTE the system processes the line of data...

Page 9: ...another character into this position If the line contains a character in the last 64th position the insert function is ignored Scroll Up When you press this key each displayed line moves up one line...

Page 10: ...l minutes of processing that turns off the display the IN PROCESS indicator is your assurance that the system is operating When this indicator light is on the HOLD key does not stop processing EDITING...

Page 11: ...0 through 90 in a program enter 20 DEL 90 then press EXECUTE Note that DEL is invalid while entering a key group see Function Keys in Chapter 2 5100 STORAGE CAPACITY The base 5100 Model B1 has a stora...

Page 12: ...erform the following types of system operations Program Execution Start or resume execution of a BASIC program or command File Operation Load or save programs or data on tape or mark tapes Program Ope...

Page 13: ...be entered to separate parameters except between the keyword and the first parameter Each command or statement entered from the keyboard is checked for syntax errors If a syntax error is detected an u...

Page 14: ...is 10 for this optional entry Each statement number generated by the AUTO command is followed by a blank then the cursor as shown 0010 Note About AUTO Automatic numbering continues until any other val...

Page 15: ...s you can change the operating mode with the GO command Program execution can be continued with the next sequential statement or at a statement number specified in the GO command You can also change t...

Page 16: ...rounding n can be 1 to 13 and is initialized to 6 If not specified n retains its last value Notes About GO The statement number entry is valid only during execution of a BASIC program When the input l...

Page 17: ...number is to be displayed If PRINT is also specified the entire work area starting with the indicated line number will be printed If no line number is entered the lowest line number in the work area...

Page 18: ...up to 128 characters The line length will not affect the execution of the statement If listing data lines longer than 118 characters bytes the excess over 118 char acters is not displayed Example The...

Page 19: ...n tape unit address E80 Auxiliary tape unit device address is E40 Entering a LOAD command of LOADO clears the entire work area including all key groups A LOAD command specifying BASIC or DATA as the s...

Page 20: ...ded to the work area If corre sponding KEYx files already exist in storage they are replaced by the new keys For example if a new KEY6 function is loaded from tape it will replace the existing KEY6 fu...

Page 21: ...e line and continue loading If you load a SOURCE file containing a line longer than 64 characters you will get an error The error must be corrected or the line must be scrolled up which ignores the li...

Page 22: ...be edited by first loading it back into the work area with a LOAD command When saved on tape the line numbers and DATA are again removed Function Keys Ten function keys are available for your use in...

Page 23: ...ed while CMD is pressed the constant RATE is inserted into the line being entered from the keyboard In the following examples the function keys will be assigned a number of functions First the LOADO K...

Page 24: ...function For example KEY6 10DEL deletes line 10 from key group 6 KEY6 1ODEL90 deletes lines 10 through 90 from key group 6 Statements can be added in the same manner KEY6 10 PRINT A adds line 10 or r...

Page 25: ...efore entering GO only in the first two positions of the line If you end the operation by entering anything other than GO in positions 1 and 2 the file already marked is unchanged Note If an existing...

Page 26: ...ror A REWIND command is generally required before this MARK You can determine the size required for a file by comparing the amount of work area available before and after you have entered data or prog...

Page 27: ...es an error message to be displayed see Appendix B As the lines are merged you can specify that lines merged from the file be renumbered starting with a statement number of your choice and increasing...

Page 28: ...e MERGE 6 2 200 ESO Omitted new line num Example A sample MERGE command is as shown MERGE 6 4 200 1 O E40 In this example data from file number 6 in the auxiliary tape unit will be merged with data in...

Page 29: ...following file types Data exchange file type 01 General exchange file type 02 BASIC source file type 03 APL internal data file type 08 Copy the contents of one tape cartridge to another tape cartridge...

Page 30: ...layed causes the options to be redisplayed Once you have entered an option number additional prompts if any are displayed for the option selected Option 1 Copy IMF Tape The copy IMF tape option allows...

Page 31: ...d into storage only if they apply to the 5100 on which the load IMFs program is running The IMFs will occupy storage in the work area work space so IMFs should not be applied if the problem does not a...

Page 32: ...covered Some of the data preceding and following the record on which read errors occur may not be recovered Tape recovery assumes that the cartridge containing files which cause read errors is inserte...

Page 33: ...that will be printed or displayed If more digits are to be printed or displayed they will be rounded to the number specified At power on rounding is initially set to six digits Rounding can then be mo...

Page 34: ...the key group header record The syntax of the RENUM command is as shown RENUM KEYxl first line num incrementl where KEYx specifies a key group x 0 to 9 to be renumbered first line num is an integer 1...

Page 35: ...NUM command RENUM 20 10 then press EXECUTE Before After 0010 INPUT A B 0020 INPUT A B 0011 Q INT A B 0030 Q INT A B 0020 IFQ 0 THEN 30 0040 IFQ 0 GOTO 0060 0025 GOTO 10 0050 GOTO 0020 0030 PRINT Q 006...

Page 36: ...ified tape unit The syntax of the REWIND command is as shown REWIND dev address where Example dev address is the address of the tape unit to be rewound E80 for the built in tape unit or E40 for the au...

Page 37: ...ber of each statement executed is displayed and or printed while the statement is executed Both step and trace modes are useful in locating programming errors Trace provides a more rapid view of the p...

Page 38: ...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 Example Some sampl...

Page 39: ...g another file with the correct amount of available space The syntax of the SAVE command is as shown SAVE file num dev address file 10 SOURCE where file num is an integer specifying the file in which...

Page 40: ...rruption occurs before the file has been changed the file remains unchanged If the interruption occurs after the file has been changed the file is reinitialized to unused status IMFs are not stored wi...

Page 41: ...n interrupt the listing to either the display or printer by pressing the ATTN key which will terminate the command or by pressing HOLD and pressing HOLD again to continue The following information is...

Page 42: ...s be invoked This must be the only entry in a UTI L command invoking communications PRINT specifies that the listing be printed If the printer is not specified output is displayed DIR integer specifie...

Page 43: ...orage in K First Statement Number 001 j 0 3 00 1 o I 11 1 PI UG f LIS DATA File Number 010 005 U U010 2 50 U08 002 0 0020 3680 j OO O 2 J o O j O 5 O 0 Defined Function Keys F I T 1714 i Last Statemen...

Page 44: ...ctical meaning in the BASIC language fall into three categories alphabetic numeric and special characters Alphabetic Characters The alphabetic characters in BASIC are the uppercase letters of the Engl...

Page 45: ...equal symbol 0 Less than or equal symbol Greater than or equal symbol OR sign or vertical bar Use of Blanks Blanks may be used freely throughout a program to improve readability They have no syntacti...

Page 46: ...r a given number depends on its magnitude and the level of arithmetic precision you require Numbers in any format can be positive or negative Negative numbers must be preceded by a minus sign When no...

Page 47: ...ers in floating point format are Floating Point Equivalent Decimal Number Value 25E 4 000025 1 0E 5 100000 5E 7 0000005 15 33E6 15330000 Selecting An Arithmetic Format You can enter arithmetic values...

Page 48: ...inch INCM 2 540000000000 Kilograms per pound LBKG 0 453592370000 Liters pergallon GALI 3 785411784000 The internal constant names can only be used as parts of arithmetic expressions and can be preced...

Page 49: ...put line which is 64 including quotation marks Character Variables A character variable is a named item of character data whose value is subject to change during execution of the program Character var...

Page 50: ...rred to by the name of the array followed by a sub script in parentheses which indicates the position of the element within the array The general form for referring to an array element is array name r...

Page 51: ...t When an array is declared implicitly by a reference to one of its elements when its name has not appeared in a prior USE or DIM statement it will have the number of dimensions specified in the refer...

Page 52: ...rithmetic array contains only numeric data and can have one or two dimensions Arithmetic arrays are named by a single letter of the extended alphabet A Z and Thus the letter A can be used to name an a...

Page 53: ...igure 7 shows a summary of the naming conventions previously described for vari ables and arrays The symbol ext in Figure 7 denotes a letter of the BASIC extended alphabet A Z and Information in brack...

Page 54: ...of x Cosine of x radians Cotangent of x radians Cosecant of x radians Number of degrees in x radians Determinant of an arithmetic array Natural exponent of x Hyperbolic cosine of x Hyperbolic sine of...

Page 55: ...ed with the IF state ment to test the truth of specified relationships between two values Expressions referring to entire arrays rather than individual array elements are called array expressions An e...

Page 56: ...spectively are both commutative in other words A B B A and A B B A However multi plication and addition are not always associative because of low order rounding errors for example A B C does not neces...

Page 57: ...ated by being reduced to its component subexpressions A subexpression is defined as a group that can be read operand operator operand where an operand is one of the following A simple reference to dat...

Page 58: ...and Result 4t2 6 2 2 5 16 6 2 2 5 16 6 2 2 5 16 3 2 5 16 7 5 8 5 4t2 6 2 2 5 16 6 2 2 5 16 6 2 2 5 16 3 2 5 16 7 5 8 5 4t 2 6 2 2 5 4t 2 3 2 5 4t5 2 5 1024 2 5 1024 2 5 2560 4t 2 6 2 2 5 4t 8 2 2 5 4t...

Page 59: ...mat of a relational expression is el relational operator e2 where el and e2 are any expressions other than array or relational expressions and relational operator is any of the operators just describe...

Page 60: ...acters of B In statement 20 A is the expression from which characters are to be extracted 1 is the position of the first character to be extracted and 10 is the number of characters to be extracted Co...

Page 61: ...r regardless of the order in which they were entered unless the sequence of execution is altered by branches loops or subroutines The allowable range of statement numbers for a 5100 BASIC program is f...

Page 62: ...ogram to a specific statement IF Branches the program depending on specific conditions Image Specifies formatting of data to be displayed or printed INPUT Assigns values from the keyboard to variables...

Page 63: ...age statement PUT Writes the values of specified variables into a tape file READ Assigns values from the internal table see DA TA to variables or array elements REM Inserts comments or remarks into a...

Page 64: ...pression is evaluated and truncated to an integer This integer identifies the file containing the new program on the device specified A simple constant can also be used All open files in the current p...

Page 65: ...file reference is required Notes About CLOSE If a file is used for both input and output operations during execution of a single program the file must be closed and reopened between input and output...

Page 66: ...ointer can be changed to point to the first constant again by the RESTORE statement DATA statement character constants containing less than 18 characters are padded on the right with blanks to a lengt...

Page 67: ...ample DATA statement is as shown 110 DATA BILL 21 60 CHARGE 15 40 In this example the character constants BI LL and CHARGE and the arithmetic constants 21 60 and 15 40 are inserted into the internal d...

Page 68: ...ion name is any character of the extended BASIC alphabet This character with FN is the name of the defined function arith var is one or more simple arithmetic variables to which a value will be assign...

Page 69: ...ion in a RETURN statement Notes About DEF A function can be defined anywhere in a BASIC program either before or after it is referenced A function of a given name can be defined only once in a given p...

Page 70: ...er value 72 after execution of statement 80 When statement 80 is executed the current value of Y which is 2 is substituted for each occurrence of the dummy variable X in the arithmetic expres sion of...

Page 71: ...rray whose name is specified in a DIM statement is defined as having the number of elements represented by the rows entry A two dimensional array whose name is specified in a DIM statement is defined...

Page 72: ...A sample DIM statement is as shown 20 DIM Z 5 A 4 2 The result of the preceding statement is Z five strings array elements of 18 blank characters each Array A has 4 roiNs of 2 columns each o 0 o o o 0...

Page 73: ...ended It can be entered anywhere in a BASIC program When an END statement is encountered during execution of a program it causes all open files to be closed and it terminates pro cessing The actions o...

Page 74: ...FNEND comment FNEND For a complete description of the FNEND statement see DEF FNEND RETURN 70...

Page 75: ...tive increments the final value the loop is not executed Instead the value of the control variable is left unchanged and control goes to the statement following the NEXT statement If the loop is execu...

Page 76: ...or out of a FOR loop is permitted however a NEXT statement cannot be executed unless its corresponding FOR statement has been executed previously FOR loops can be nested within one another as long as...

Page 77: ...specified in an OPEN statement var is a simple variable a subscripted array reference or a substring reference Only one variable is required If more than one is entered they must be sepa rated by comm...

Page 78: ...h meticor character as the corresponding variable A GET statement referencing a currently closed file causes program execution to be terminated Exampfe A sample GET statement is as shown 0090 GET FL4...

Page 79: ...ion of a simple GOSUB statement causes an unconditional transfer of con trol to the statement whose number is specified Execution of a computed GOSUB statement causes the arithmetic expression to be e...

Page 80: ...owing example shows a GOSUB to a keys function 100 GOSUB 9994 _______ LOADO KEY4 9994 REM 9994 PRINT IN MAIN PROGRAM 9995 RETURN 0010 PRINT IN KEYGROUP 9994 0020 RETURN In this example statement 100 c...

Page 81: ...ses the arithmetic expression to be evaluated and control transferred to the statement whose numeric position in the list of statement numbers reading left to right is equal to the truncated integer v...

Page 82: ...ment to which control is transferred if the relational expression s is true When an IF statement is executed the expressions are compared as specified by the relational operator If the relationship is...

Page 83: ...tem Comparison for equal must compare exactly to 13 digits Example The following examples show a variety of IF statements 30 IF A 3 1 X 2 Z GOTO 85 40 IF R CAT GOTO 70 50 IF S2 37 222 GOTO 120 60 IF X...

Page 84: ...ng char string print Image print Image 80 IMAGE The image statement is used to control formatting of printed or displayed data For a complete description of the image statement see PRINT USING and Ima...

Page 85: ...an INPUT statement is executed it displays a question mark on the display screen and program execution halts You must then enter a list of values that will be assigned in the order they are entered to...

Page 86: ...cter constant must be enclosed in single quotation marks The number of values entered at execution time must be equal to the number of variable references specified in the INPUT statement If you do no...

Page 87: ...ied The row and column references to an array element must be enclosed in parentheses exp is an arithmetic or character expression a string function or a character constant When the LET statement is e...

Page 88: ...atements are as shown 10 LET Z CAT 20 LET X 9 30 LET V X 2 40 V X X XIV X 50 LET A X 0201130903 After execution of statement 10 the character variable Z will contain the word CAT followed by 15 blank...

Page 89: ...INEXT control var NEXT For a complete description of the NEXT statement see FOR and NEXT f 85...

Page 90: ...by the file reference code Valid addresses are E80 for the built in tape unit E40 for the auxiliary tape unit and 500 for the printer file num is a constant or numeric variable The value of the file n...

Page 91: ...specified by the program if PRINT is used to write the file The following example shows a single file creation with a negative file number 10 F 1 20 OPEN FL2 E80 F OUT 30A X E3 40 PRINT FL2 0090 PRINT...

Page 92: ...n is interrupted and the message PAUSE s is shown on line 0 of the display screen where s is the line number of the PAUSE statement To resume program operation you must issue a GO command Note that yo...

Page 93: ...try is optional FLO to FL9 must have been previously opened in an OPEN statement exp are arithmetic or character expressions to be displayed or printed Expressions can be separated by a comma or semic...

Page 94: ...se line of output than full print zones The semicolon and null delimiters are used to specify packed print zones The length of packed print zones for various types of data is explained under Spacing o...

Page 95: ...a denser line of output than full print zones Length of Converted Length of Packed Example 16 Data Item Print Zone represents a Characters Characters blank 2 4 6 167 31616 5 7 9 1617 3571616 8 10 12...

Page 96: ...mber consisting of a sign blank or minus up to 13 signif icant digits and a decimal point in the appropriate position is printed or displayed The F format is used to print or display values not includ...

Page 97: ...printed or space the contents of displayed and the pointer the first record are writ is set to the start of the ten and the expression next record will start at the beginning of the next record Semic...

Page 98: ...at the beginning of the next record If the end of the record is encoun tered before the char acters are written the record is printed or dis played and the remaining characters will be written starti...

Page 99: ...Comma No data is displayed The pointer is moved past Constant any remaining spaces in the Semicolon full print zone If the end of the record is reached the record is printed or displayed and the poin...

Page 100: ...ced After all data for a print line has been placed in the buffer the data line is printed A buffer position pointer is used to keep track of the next available position where a character or digit can...

Page 101: ...P A B 20 PRINT A B 30 LET A B 40 PRINT FLP A A 50 PRINT FLP A A A A 60 PRINT A A 70 LET A 80 PRINT FLP A A A 90 PRINT A A 100 PRINT FLP 110 PRINT NAME TAB 30 ADDRESS 120 PRINT A TAB 30 B TAB 40 C 130...

Page 102: ...gical file into which the formatted data is to be placed or FLP to specify printing If not spec ified otherwise the formatted data is displayed FLO to FL9 must have been previously referenced in an OP...

Page 103: ...a sign and the expression value is negative a minus sign and the negative number will be printed provided that the format specification is long enough to contain both the number and the sign If the fo...

Page 104: ...hown I Format integer format An oPtional sign followed by one or more char acters as shown l J F Format fixed decimal format An oPtional sign followed by either 1 No characters a decimal point and one...

Page 105: ...ered and a The following character is not a character or b The following character is another decimal point or f c The following four consecutive characters are not I characters 1111 Some examples of...

Page 106: ...blank the current line is displayed or printed and the next output will start on a new line If the delimiter is a semicolon the current line is not displayed or printed and the next output will be add...

Page 107: ...fied file beginning at the current file position The file is written sequentially so that the first value entered by the PUT statement will be the first value assigned from the file when the file is r...

Page 108: ...Example A sample PUT statement is as shown 20 PUT FL1 23 5 X 7 A D 9 005 In this example the specified values will be written into file Fl1 104...

Page 109: ...the variables in the READ statement from left to right beginning at the current position of the data table pointer The data table pointer can be returned to the beginning of the table by the RESTORE...

Page 110: ...nd B will contain the character strings JONES and SMITH respectively each padded on the right with blanks to a length of 18 The arithmetic variables A1 and B1 will contain the decimal values 15 00 and...

Page 111: ...ere comment is one or more characters This is an optional entry The REM statement is nonexecutable It appears in program listing but has no affect on program execution Notes About REM A REM statement...

Page 112: ...PEN statement the first item in the file is auto maticallyaccessible When RESET END is specified the file is closed and reopened for output The file is reset so that writing of new data begins at the...

Page 113: ...s the internal data table pointer from its current position to the beginning of the table The optional comment is a character string that does not affect the execution of the statement Notes About RES...

Page 114: ...N For the use of the RETURN statement in the creation of subroutines see the GOSUB and RETURN statements Also see Function Keys For the use of the RETURN statement with a multiline function definition...

Page 115: ...or more characters When a STOP statement is encountered during execution of a program it causes all open files to be closed and it terminates processing The actions of the STOP state ment are identica...

Page 116: ...mns are required only for arrays These nonzero unsigned integer constants specify the number of rows and columns to provide the dimensions of the array assigned to the common area of storage Notes Abo...

Page 117: ...T statements arrays and matrices must have been previously defined either implicitly or explicitly in a DIM or USE statement MAT ASSIGNMENT STATEMENTS MAT assignment statements allow you to assign val...

Page 118: ...redimension specifications are included the truncated integer portion of each expression in rows columns is used to redimension the array before the scalar value is evaluated and assigned to each of t...

Page 119: ...Example The following example shows the execution of a MAT assignment scalar statement 40 DIM Y 3 3 50 MAT Y 2 2 1 The resulting values are Y is Columns Rows 115...

Page 120: ...of the array specified to the left of the equal sign If redimension specifications follow the name to the left of the equal sign the truncated integer portion of each expression value in rows columns...

Page 121: ...The resulting values are represented below a b e f If B and A c d g h then after statement 100 a b a b B A c d c d 117...

Page 122: ...ual sign are added or subtracted as indicated and the result of the operation is assigned to the corresponding elements in the mat ix specified to the left of the equal sign If redimension specificati...

Page 123: ...Example The following example shows execution of 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 f a e b f If Y and Z then X c d g h c g d h 119...

Page 124: ...r portion of each expression value in rows columns is used to redi mension the matrix before values are assigned to it Notes About MAT Matrix Multiplication All three matrices specified must be numeri...

Page 125: ...The following example shows the execution of this MAT assignment statement 10 DIM X 2 2 Y 2 2 Z 2 2 100 MAT Z X Y The resulting values are a b e f a e b g a f b h If X and Y then Z c d g h c e d g c f...

Page 126: ...d in parentheses The scalar expression is evaluated and each element in the matrix to the right of the equal sign is multiplied by the value of the expression The result is assigned to the correspondi...

Page 127: ...Example The following example shows execution of a MAT assignment statement 20 DIM X 2 2 Y 2 2 100 MAT Y 4 X The resulting values are a b If X t len Y c d 123...

Page 128: ...2 2 or A 3 3 is assigned the integer value 1 All other elements for example A 2 3 or A 3 1 are assigned the value O If redimension specifications follow the matrix name the truncated integer portion o...

Page 129: ...Example The following example shows the executiC n of a MAT identity function statement 50 DIM X t6 60 MAT X 4 4 IDN The resulting values are 0 0 0 0 0 0 X is 0 0 0 0 0 0 125...

Page 130: ...ical dimen sions such that A B B A I where I is an identity matrix Not every matrix has an inverse The system function DET see System Functions can be used to determine if a given matrix has an invers...

Page 131: ...lowing example shows execution of a MAT inverse statement 20 DIM X 2 2 Y 2 2 80 IF DET Y 0 GOTO 300 90 MAT X INV Y 295 GOTO 310 300 PRINT SINGULAR MATRIX 310 END The resulting values are If Y is then...

Page 132: ...lues in column y of one array become the values in row y of the other array If redimension specifications follow the array name to the left of the equal sign the truncated integer portion of each expr...

Page 133: ...Example The following example shows the execution of a MAT transpose function statement 40 DIM A 3 2 B 2 3 80 MAT B TRN A The resulting values are If A is a b d thenBis e c f 129...

Page 134: ...xecuted the file values are assigned to the specified arrays row by row The referenced file must have been previously opened for input by an OPEN statement The file is positioned at its beginning for...

Page 135: ...0090 MAT GET FL2 A B 5 10 Z 4 5 EOF 210 In this example array A array B redimensioned to 5 rows 10 columns and array Z redimensioned to 4 rows 5 columns will receive values from file FL2 When end of f...

Page 136: ...processed by pressing EXECUTE If the array specified has not been filled the question mark is displayed again to indicate that more input is required Character constants that contain less than 18 char...

Page 137: ...Example The following example shows a MAT INPUT statement 0100 MAT INPUT A A 8 3 6 Upon execution of this statement you must enter values for arrays A A and 8 redimensioned to 3 rows 6 columns 133...

Page 138: ...fied When a MAT PRINT statement is executed each array element is converted to a specified output format and displayed See Conversion of Data Reference Values under the PRINT statement Each array is d...

Page 139: ...ay screen or printer buffer an internal line position pointer is maintained to keep track of the next available posi tion where a character or digit can be placed If the array delimiter is a comma the...

Page 140: ...AT 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 B C 0 E F G H I J K L 50MATC 1 60 MAT PRINT A 70 MAT PRINT A 80 MAT PRINT C Displayed output wil...

Page 141: ...to the format specified in the image statement Only one array name is required Array names can be separated by a comma or semicolon The last array name can also be followed by a comma or semicolon The...

Page 142: ...e last row of the last array is printed or displayed the delimiter following that reference in the MAT PRINT USING statement causes the following If the delimiter is a comma or blank the current line...

Page 143: ...ng example shows execution of a MAT PRINT USING statement 0010 DIM A 4 3 0020 II II 0030 MAT A l 0040 MAT PRINT USING FLP 0020 A The output would appear as 1 l O 1 lE j j 1 0 1 01 0 1 1 i O 1 E 0 1 1...

Page 144: ...r GET statement When the buffer becomes full the contents are written out as a record A file can only be activated by an OPEN statement and is deactivated by a CLOSE statement or at the end of program...

Page 145: ...ement or to entire arrays in the MAT READ statement The values are assigned to the array by rows beginning at the current position of the data table pointer The data table pointer can be reset by use...

Page 146: ...hows a MAT READ statement 0100 MAT READ A 2 A 8 12 In this example array A is redimensioned to two elements of 18 characters each array 8 is redimensioned to 12 rows and then values from the data tabl...

Page 147: ...nding OPEN statement The 5100 allows you to specify file description information which is provided by the operating system in 370 VS BASIC The 5100 allows you to CHAIN to a specified program without i...

Page 148: ...L command to move the tape to the last marked file 2 Use the MARK command to mark from the last marked file to the end of the tape For example MARK 200 1 n where n is the number of the last marked fi...

Page 149: ...e work area Data Type Number of Bytes Required Character variable 22 Character array Numeric variable Numeric array 18 times the number of elements plus 8 12 8 times the number of elements plus 8 Beca...

Page 150: ...146...

Page 151: ...ly keyboard and their relative value lowest tolhighest Sequence Sequence Character Number Character Number blank 65 127 76 t 139 77 141 78 174 79 175 80 190 81 191 91 A 194 if 92 B 195 93 C 196 94 D 1...

Page 152: ...Sequence Sequence Character Number Character Number 0 215 y 233 P 216 Z 234 0 217 0 241 R 218 242 225 2 243 S 227 3 244 T 228 4 245 U 229 5 246 V 230 6 247 W 231 7 248 X 232 8 249 9 250 148...

Page 153: ...om each execution error with one of the following procedures labeled or Enter GO or GO END to end the program or enter GO x to continue where x is the statement number of any statement in your program...

Page 154: ...remes as described under Tape Cartridge Handling and Care If the error occurs during an operation retry If the error occurs while attempting a com mand or opening a file rewind and retry If the retry...

Page 155: ...Optionally the EOF statement number may be designated in GET or MAT GET statement The EOF statement number specifies the statement number to which the program branches when end of file is encountered...

Page 156: ...ed Statement following LOADO KEYx was not a header statement statement not accepted Recovery Be sure the correct cartridge is loaded Then specify the correct file number Issue a REWIND command then re...

Page 157: ...ded or defined as null Define function for the key before retrying request terminated 114 Next line generated by AUTO will exceed 9999 AUTO is terminated 115 RENUM will cause a line 9989 Change to a s...

Page 158: ...location Dimensions incorrect for function used and product array specified ION function specified for a matrix that is not square Array referenced in a MAT statement not previously defined in a DIM o...

Page 159: ...tatement 171 Statement number displayed references a statement not in the program 172 FNEND statement not found for a DEF C statement 173 No matching NEXT statement for a FOR or the control variable d...

Page 160: ...DET function or unde G fined matrix G 226 Reference to an undefined user function 227 Incorrect number of parameters specified on G a user defined function reference 228 Argument for LOG is zero or n...

Page 161: ...ere is frost or moisture on the external sur faces or visible on the internal parts acclimate the machine for 8 hours after the frost and moisture disappears This is to make sure all internal moisture...

Page 162: ...el switches a Turn the BRIGHTNESS control to get the best character definition b Set the DISPLAY REGISTERS switch to the NORMAL position c Set the L3264 R32 switch to the center 64 position d Set BASI...

Page 163: ...e displayed as the keys are pressed If you make a keying error you can press the backspace key above EXECUTE to backspace the cursor and then press the correct key If you pressed EXECUTE and the line...

Page 164: ...on under the APL checkout procedures insert the tape cartridge into the 5100 and go to step 6 Remove an unused or scratch tape cartridge from its package Check that the arrow is pointing away from the...

Page 165: ...tape is already marked To re mark the tape press the following keys JG When READY is shown continue G 0 o 6 Press the following keys J J JQO o 7 The last step wrote the program onto tape but the progr...

Page 166: ...ined machine set the BASIC APL switch to the APL position press RESTART and go to the APL checkout procedure in Appendix A of the IBM 5100 APL Reference Manual SA21 9213 If you already did the APL che...

Page 167: ...on the rear panel as shown in the preceding diagram o 4 Remove the shipping tape from the power line and plug the power line into a grounded electrical outlet 05 Set the auxiliary tape unit POWER swi...

Page 168: ...eckout procedure CJ GJQ GJ0 0 GJ C _ J 0 o 3 The tape will move and when READY is again displayed press these keys 04 READY is again displayed to verify that the program was written back to tape and w...

Page 169: ...d or to the back of the 5100 Make sure the connectors fit squarely Turn the knob in a clockwise direction until the connectors fit together firmly o 4 Remove the shipping tape from the printer power l...

Page 170: ...n o 6 Insert paper in the printer Use the printer information in this manual if you 07 need help in inserting the p aper see Appendix D Set both the printer and 5100 POWE R switches to ON and continue...

Page 171: ...should contact the metal clips on the cover The stacker can be bent if too much weight is applied Under normal conditions printed forms should not be allowed to accumulate higher than 1 inch in the s...

Page 172: ...168...

Page 173: ...idual or continuous forms Maximum number of copies is six but for optimum feeding and stacking IBM recommends a maximum of four parts per form Adjustable forms tractor that allows the use of various w...

Page 174: ...the forms gUide rack in the horizontal position The diagrams below and to the left show the proper forms path for singlepart and multipart forms 4 Push the paper release lever to the rear to acti vate...

Page 175: ...r advance knob to position the form Paper Advance Knob for the first line to be printed The paper should exit over the forms guide rack Note To move the form backward turn either paper advance knob ba...

Page 176: ...he form in position behind the platen and against the cut forms guide 7 Turn the paper advance knob to position the form for the first line to be printed Improve the paper alignment if necessary by us...

Page 177: ...dial toward 0 one click at a time to obtain the legibility you desire 3 If you are using multipart forms and the ribbon is smudging the first sheet rotate the copy control dial toward 8 one click at a...

Page 178: ..._ disengage it from the clip on the print head 9 Lay the ribbon loop on the top of the ribbon in the rib bon box Pick up the entire ribbon and discard it 10 11 Disk Ribbon Holder Eject the new ribbon...

Page 179: ...he loop through the slot in the Release Knob bottom of the ribbon box Ribbon Box 18 Thread the ribbon through the guide shoe and around the left guide post 19 Insert the horizontal part of the ribbon...

Page 180: ...6L _ EI X 65 r X 66 A X f _ X X 68 X 69 X 6A _ 41 X 6B T X 6C i X 6 1 X 6E X 6F X 70 X 71 t X 72 X 7 5 X 71 J A X 7 5 m X 76 ij X 7 j X 78 A X 79 fF X 7A r X 7B N X 7C t X 7D C X 7E 6 X 7F Ill A X SO...

Page 181: ...nsiderations 145 capacity storage 7 centimeters per inch INCMI 44 CHAIN statement 60 66 112 143 changing execution mode 11 character arrays 49 132 character constants 19 45 62 81 132 character data 45...

Page 182: ...c tangent of x 50 178 I format 92 99 I format numbers 42 IF statement 78 IMAGE statement 80 137 IMFs 25 38 IN PROCESS indicator 6 indicators 6 initializing tape files 21 161 intializing variables 44 i...

Page 183: ...48 114 relational expressions 51 55 78 REM function keys 19 REM statement 107 RENUM command 30 renumbering statements 23 30 88 replacing printer ribbon 173 RESET statement 108 RESTART switch 5 144 15...

Page 184: ...41 USE statement 60 112 143 user file identification 35 37 86 user defined arithmetic functions 64 UTiL command 37 variables 40 5100 setup procedure 157 5103 printer 169 5103 printer setup procedures...

Page 185: ...in publication typographical illustration and so on No reply Page Number Error Note All comments and suggestions become the property of IBM No postage necessary if mailed in the U_S A Inaccurate or m...

Page 186: ...45 Rochester Minnesota 55901 International Business Machines Corporation General Systems Division 57750 Glenridge Drive N E P O Box 2150 Atlanta Georgia 30301 U S A only General Business Group Interna...

Page 187: ...ion 57750 Glenridge Drive N E P O Box 2150 Atlanta Georgia 30301 U S A only General Business Group International 44 South Broadway Wh ite Plains New York 10601 U S A International SA21 921 7 3 2727J2j...

Reviews: