|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 161408 (0x27680) Types: TextFile Names: »D18«
└─⟦3d57f1d87⟧ Bits:30005867/disk03.imd Dokumenter (RCSL m.m.) └─⟦this⟧ »D18«
Introduction to RC COMAL First Edition A/S REGNECENTRALEN March 1978 Information Department RCSL 42-i 0784\f Author: Thorkild Maaetoft and Børge Christensen Text Editor: Inga Marcussen KEY WORDS: RC 7000, RC 3600, RC COMAL, BASIC, Introduction, Brief language summary. ABSTRACT: This introduction defines the extensions, regarding the BASIC generally used, which are implemented in RC COMAL. The special use of the floppy disc and card reader are also described. The final chapters contain a summary of RC COMAL. REMARKS: Issued by A/S Regnecentralen in co-operation with the Computer Divison of the Tønder Statsseminarium. Users osv. Copyright A/S Regnecentralen, 1978 Printed by A/S Regnecentralen, Copenhagen\f CONTENTS 1 WHAT IS RC COMAL Page5 2 NAMES OF VARIABLES, ASSIGNMENT OF VARIABLES7 2.1 Names of variables7 2.2 Assignment of variables 7 3 ADVANCED CONTROL STRUCTURES8 3.1 If p THEN .. ELSE .. ENDIF8 3.2 If p THEN .. ENDIF9 3.3 REPEAT .. UNTIL p10 3.4 WHILE p DO .. ENDWHILE11 3.5 CASE expr OF .. WHEN .. ENDCASE12 3.6 Procedures14 4 OPERATORS16 4.1 Boolean expressions16 5 TERMINAL COMMANDS18 6 SYSTEMS WITH A CARD READER19 7 SYSTEMS WITH FLOPPY DISCS21 8 SUMMARY OF RC COMAL23 8.1 RC COMAL statement types24 8.2 RC COMAL standard functions28 8.2.1 Functions for processing text strings 30 8.3 Matrix operations in RC COMAL30 8.4 Commands to logical discs32 8.5 Statements for file processing33 8.6 System commands in RC COMAL35 8.7 Commands in connection with batch runs37 \f 1 WHAT IS RC COMAL? Since 1970 Regnecentralen has marketed the RC 7000 Minicomputer System, primarily for teaching institutions. T_o_d_a_y_, in 1978, there are RC 7000"s installed in over 100 schools, colleges, universities and other educational institutions, which makes it the most used mini-computer system for educational purposes. Originally the RC 7000 was based on the hardware and software of the American firm Data General. The most frequently used pro- gramming language was BASIC, due to the many benefits contained in this language, especially for elementary teaching. The RC 7000 is an all-Danish computer as both hardware and soft- ware are developed and produced in Denmark by Regnecentralen. As early as 1974, users ofthe RC 7000 expressed their wish for an extension of Data General"s extended BASIC. It was found that BASIC had some general shortcomings which made it less suitable, for example, for procedure orientated structures. The programming language COMAL was defined by Lecturer Benedict Løfstedt, Århus University, and Lecturer Børge Christensen, Tønder Statsseminarium (Teacher Training College). The language contains extended BASIC, as the aim was that COMAL should be a further development of BASIC. A first version of COMAL was developed on an RC 7000 by Per Christiansen and Knud Christensen at the computer division of the Tønder Statsseminarium in 1975. More than three years experience with COMAL EDP teaching at commercial schools, teacher training colleges and in ordinary schools has shown that COMAL is e_a_s_i_e_r_ t_o_ _l_e_a_r_n_ than BASIC, one of the reasons being that it results in programs which have a c_l_e_a_r_e_r_ _s_t_r_u_c_t_u_r_e_ and are therefore e_a_s_i_e_r_ t_o_ _r_e_a_d_ than the corresponding BASIC programs. By reading through this introduction to RC COMAL, the reader will understand why this is so. RC COMAL is the final version of the COMAL language, and has been developed by A/S Regnecentralen in continuous co-operation with teachers from teacher training colleges, high schools and other schools. RC COMAL contains significant improvements in relation to the originally defined COMAL, and these improvements all aim\f at making the language into an easy and flexible tool for teaching in all places of education. Incidentally, COMAL is an abbreviation of: C_O_M_mon A_lgorithmic L_anguage.In the definition of the language, emphasis has been put on the basic a_l_g_o_r_i_t_h_m_ _s_t_r_u_c_t_u_r_e_s_ being easy to describe and easy to recognise. This introduction is not meant as a textbook of RC COMAL. The introduction has been written for readers who know the most important language elements in BASIC, and contains therefore no definitions or explanations of the most simple RC COMAL/BASIC sentences. This book contains first a description of extensions and new language elements in RC COMAL in relation to BASIC. The last chapter is a total survey, in diagrammatic form, of RC COMAL. Additional literature about RC COMAL: "RC COMAL Programming Guide", published by A/S Regnecentralen. Børge Christensen: "RUN COMAL", published by Studentlitteratur. Børge Christensen: Problems for "RUN COMAL", by the samepublisher.\f 2 Names of variables, assignment of variables 2.1 Names of variables In RC COMAL, variables of all types are named according to the prescription: t t ....... t , i <8, where t is a letter, while t , ....... t are letters or digits. E_x_a_m_p_l_e_s_ LET INTEREST = CAPITAL * INTEREST RATE * NUMDAYS/360/100 LET NAME< = "OLE OLSEN" LET TABLE (NUMBER, YEAR) = 126 2.2 Assignment of variables In RC COMAL, LET sentences may contain more than one assignment: LET var = expr ; var = expr ; .....; var = expr , where var , var , ....., var are names of variables, while expr expr , ....., expr are constants, variables or formulae. A LET sentence may contain as many assignments as the length of the line permits. E_x_a_m_p_l_e_s_ LET INTEREST RATE = 12; CAPITAL = 15000; NAME< = "OLE OLSEN" This sentence has the same effect as three consecutive LET sentences, each with its own assignment. \f 3 Advanced control structures In addition to the control structures in BASIC, the following are found in RC COMAL: (1) IF p THEN .. ELSE .. ENDIF (2) IF p THEN .. ENDIF (3) REPEAT .. UNTIL p (4) WHILE p DO .. ENDWHILE (5) CASE expr OF .. WHEN .. ENDCASE 3.1 IF p THEN .. ELSE .. ENDIF The structure is built up as follows: IF p THEN A t f ELSEp AB B ENDIF p is a Boolean expression (an open statement); if p has the value "true", then the program portion A described between IF p THEN and ELSE is carried out, and if p has the value "false", the pro- gram portion B described between ELSE and ENDIF is carried out. When either A or B has been carried out, the program continues with the next sentence after ENDIF. The portion of the program text positioned between the control sentences is inserted when a program list has been printed out (see FOR .. NEXT in BASIC). \f E_x_a_m_p_l_e_s_ IF PRICE <100 THEN PRINT "YOU MUST PAY (INCL. CHARGE): "; PRICE + 15;"KR." ELSE PRINT "YOU MUST PAY: "; PRICE; "KR." ENDIF INPUT "CHARACTER: ", CHARAC LET SUM = SUM + CHARAC; NUMCAR = NUMCAR + 1 IF CHARAC < MIN THEN LET NEXTMIN = MIN; MIN = CHARAC ELSE IF CHARAC <NEXTMIN THEN LET NEXTMIN = CHARAC ENDIF 3.2 IF p THEN .. ENDIF The structure is built up as follows: IF p THEN t p A fA ENDIF p is a Boolean expression; if p has the value "true", then the program section A described between IF p THEN and ENDIF is carried out, and if p has the value "false", then A is skipped. In either case, the program continues with the next sentence after ENDIF. The text between IF 9 THEN and ENDIF is inserted when program lists are printed out. In an RC COMAL program, up to seven IF p THEN .. (ELSE) .. ENDIF branches inside one another are allowed. \f E_x_a_m_p_l_e_s_ READ TAL1, TAL2 IF TAL1 > TAL2 THEN LET BUFFER = TAL1; TAL1 = TAL2 = BUFFER ENDIF PRINT TAL1, TAL2 _______ IF RND (0) < 3/10 THEN LET H1 = H1 + 1 ELSE IF RND (0) < 3/9 THEN LET H2 = H2 + 1 ELSE IF RND (0) < 3/8 THEN LET H3 = H3 + 1 ELSE IF RND (0) < 3/7 THEN LET H4 = H4 + 1 ELSE LET H5 = H5 + 1 ENDIF ENDIF ENDIF ENDIF 3.3 REPEAT .. UNTIL p The structure is built up as follows: REPEAT A Af p UNTIL Pt p is a Boolean expression; the program section A described between REPEAT and UNTIL p is repeated until p has the value "true". Whenp obtains this value, the program continues with the next sentence after UNTIL p. It should be noted that the program section A is carried out atleast once if the interpreter reaches the REPEAT sentence, because the control of the loop starts from the UNTIL sentence. The textbetween REPEAT and UNTIL p is inserted when a program list is printedout.\f 3.4 WHILE p DO .. ENDWHILE The structure is built up as follows: WHILE p DO t A oA f ENDWHILE p is a Boolean expression; the program section A described between WHILE p DO and ENDWHILE is repeated as long as p has the value "true". When p has the value "false" the program continues with the next sentence after ENDWHILE. It should be noted that if p has the value "false" when the program reaches the WHILE sentence, the section A will not be carried out at all, and the interpreter will just go straight on to the next sentence after ENDWHILE. The text between WHILE p DO and ENDWHILE will be inserted when a program list is printed. In RC COMAL it is possible to have up to seven REPEAT .. UNTIL loops and up to seven WHILE .. ENDWHILE loops inside and i_n_d_e_p_e_n_d_e_n_t_ of one another. For example, there may be a total of fourteen loops of the two types inside one another independent of sequence, as long as seven of them are REPEAT loops and the rest are WHILE loops. The FOR .. NEXT loop inherited from BASIC has no influence on the number of REPEAT and WHILE loops that there may be inside one another (in RC COMAL there may be up to seven FOR .. NEXT loops inside one another). The number of IF .. (ELSE) .. ENDIF branches is also independent of any possibly inserted loops. In other words, it is actually possible to have a total of 21 loops + 7 branches built into one another in an RC COMAL program. However, the author does not remember having seen this in practical application. E_x_a_m_p_l_e_s_ INPUT "THE TWO NUMBERS:", A, B LET X = A; Y = B REPEAT (* EUCLID*) LET REST = X TOWARD Y LET X = Y; Y = REST UNTIL REST = 0 PRINT "SFD FOR"; A; "AND"; B; "IS"; X _______ \f INPUT "NAME" (SURNAME CHRISTIAN NAME): ", NAME< WHILE NAME< <> "END" DO INPUT "ADDRESS:", ADR< INPUT "TOWN (POSTNUMBER NAME OF TOWN): ", TOWN< INPUT "NEXT NAME:", NAME< ENDWHILE N_o_t_e_ The use of GOTO sentences in connection with the control struc- tures (1) - (4) may be problematic. Generally GOTOs should not be used in the program sections A and B and certainly not if these GOTO sentences refer to sentences which are outside the sentences that start or finish the said program section. On the whole, the use of GOTO should be restricted to unusual situations (for example in the case of fault in input, etc.). 3.5 CASE expr OF .. WHEN .. ENDCASE The structure is built up as follows: CASE expr OF A WHEN <list>DD1UU ADD1UU case .. of WHEN <list>DD2UU A A1 A2 . . . An ADD2UU . . . WHEN <list>DDnUU ADDnUU ENDCASE expr is an arithmetical expression (a constant, a variable or a formula), one of the Boolean constants TRUE or FALSE, or a variable string, and <list> is a list of arithmetical expressions, a list of Boolean expressions, or a list of character sequences.\f When the value of e_x_p_r_ has been calculated, the interpreter searches in the lists after the various WHEN for a value which is equal to that of e_x_p_r_. If such a value is found in <list> , the following program section A will be carried out and then the program will continue with the sentence after ENDCASE. If the relevant value is not found, the alternative section A, which is placed immediate- ly after the CASE sentence will be carried out, and then the pro- gram will continue with the next sentence after ENDCASE. The number of WHEN sentences following a produced CASE sentence is unlimited, and you may have as many CASE .. ENDCASE inside one another as you like. The texts for A, A , A , ... A are inserted in relation to the CASE, WHEN and ENDCASE sentences when a program list is printedout. E_x_a_m_p_l_e_s_ INPUT "1 = IN, 2 = LIST, 3 = SEARCH, 4 = DELETE, 5 = STOP:", JOBCODE CASE JOBCODE OF PRINT "THE CODE DOES NOT EXIST." WHEN 1 REM (*NEW CODES INPUT*) EXEC ENCODER WHEN 2 REM (*PRINTOUT OF CODE LIST*) EXEC PRINTOUT WHEN 3 REM (*SEARCH A GIVEN CODE*) EXEC SEARCH WHEN 4 REM (*DELETE A GIVEN CODE*) EXEC DELETE CODE WHEN 5 REM (*END OF DAY*) STOP ENDCASE _______ \f INPUT SVAR< CASE SVAR< OF PRINT "READ INSTRUCTIONS PROPERLY" WHEN "YES" EXEC PANE1 WHEN "NO" EXEC PANE2 WHEN "NONE", "NOTHING", "NOT ANY" EXEC PANE3 ENDCASE _______ INPUT "THE COEFFICIENTS A, B AND C", A,B,C IF A <> 0 THEN LET DETM = B* B-4* A*C CASE TRUE OF WHEN DETM > 0 LET X1 = (-B+SQR (DETM))/2/A; X2 = (-B-SQR (DETM))/2/A PRINT"X1 ="; X1, "X2 ="; X2 WHEN DETM = 0 LET X =-B/2/A PRINT "DOUBLEROOT: X ="; X WHEN DETM <0 PRINT "NO REAL ROOTS". ENDCASE ELSE PRINT "I THOUGHT WE WERE TO SOLVE QUADRATIC EQUATIONS?" ENDIF 3.6 Procedures It is a great advantage to use procedures to make the programs clear and logical in their construction. This is why RC COMAL also has an extension in this area. If a program starts with the sentence PROC <name> where <name> is a character sequence with the same format as the name of a variable (see section 2), and ends with the sentence ENDPROC this program may be called as a sub-program of another program by using the sentence EXEC <name>\f When the sub-program has been run, the interpreter continues with the sentence following immediately after the EXEC sentence from which the call to the sub-program was made. We may illustrate this in the following way: ... EXEC <name> ... END (*MAIN PROGRAM ENDED*) ... PROC <name> sub-progr. ENDPROC From a sub-program a new sub-program may be called, and so on to a total of seven. This phenomenon provides the following picture: PROC <name > PROC <name > PROC <name > ... ... ... EXEC <name > EXEC <name > EXEC <name > ... ... ... ENDPROC ENDPROC ENDPROC \f 4 Operators In addition to the usual arithmetical and logical operators, RC COMAL contains the following facilities: DIV : Whole number division, e.g. 11 DIV 4 (=2) MOD : Modulus, e.g. 11 MOD 4 (=3) AND : Logic "AND", e.g. (A > 10) AND (A < 20) OR : Logic "OR", e.g. (A <20) OR (A > 30) NOT : Logic negation, e.g. NOT (A <10) While the two first, DIV and MOD are a convenient and logical extension of the arithmetical operators, the last three (AND, OR and NOT) provide a number of special applications in connection with Boolean expressions, which will be explained in more detail. 4.1 Boolean expressions In RC COMAL, Boolean expressions may be formed in the usual Boolean algebra by using the operators AND, OR and NOT. E_x_a_m_p_l_e_s_ IF MAXNR = 0 OR LAST = 10 THEN UNTIL NAME< = "NONE" OR END = TRUE WHILE SQR (OBS) <> 25 AND OBS <> 0 DO UNTIL NODE = TRUE AND H(NODE) = 0 OR H(NODE) = LAST In RC COMAL numerical variables may be used as (pseudo) Boolean variables, because a numerical variable in the right context will be understood as a Boolean variable with the value "false" if the numerical variable in question has the numerical value 0 and the value "true" in all other cases. In other words, "true" corresponds to "different from 0", while "false" corresponds to "equal to 0". To make it easier to remember this equivalent, we have introduced in RC COMAL the constants TRUE and FALSE, which have the numerical values 1 and 0 respectively. \f E_x_a_m_p_l_e_s_ When the sentence LET WORKOUT = TRUE has been carried out, WORKOUT has the value 1 and is therefore in this sentence IF WORKOUT THEN PRINT "THE DIVISION WORKS OUT" interpreted as a Boolean variable of the value "true". Due to the stated equivalence between numerical values and true- ness values, Boolean expressions may be used in arithmetical expressions. A Boolean expression with the value "true" is in this connection interpreted as an arithmetical expression of the value 1, while a Boolean expression which has the value "false" is assigned the numerical value 0. E_x_a_m_p_l_e_s_ In the sentence DEF FNF (X) = (X<0)* (X+1) + (X=0) * X+(X>0) * (2*X+3) the function FNF is given after a "division of the definition volume". If CLOSED and DOGLOOSE are variables of the values 1 (TRUE) and 0 (FALSE) respectively, the execution of the sentence LET IND = CLOSED AND NOT DOGLOOSE will result in the variable IND being assigned the value 1 (TRUE). \f 5 Terminal commands A number of new terminal commands in addition to the usual (RUN, LIST etc.,) have been added in RC COMAL. The following should be mentioned: AUTO : Used when keying in programs.The command starts the automatic generation of line number: 10, 20, 30, .... etc. RUNL : Starts the run of a program the same way as RUN, but all printouts will be on the line printer. CON : Starts a program from the point where it was last stopped. The program may be stopped by means of a STOP statement, pressing ESC key, etc.. CONL : As CON, but continues printout on the line printer. BATCH: Starts input of programs from the card\f 6 Systems with a card reader An RC 7000 system with a card reader provides facilities for BATCH runs, i.e., automatic run of, for example, the programs of a whole class. The cards are packed in a JOB (JOB = program + control cards) and the various JOBs are packed together in a BATCH (BATCH = stack). Each JOB is provided, for example, with the following control cards: 1. SCRATCH <text>, where <text> is printed out before output from the program. 2. LIST, prints out the program. 3. RUN, starts the execution of the program. 4. EOJ, (E_nd-O_f-J_ob) completes the individual job. When the individual JOBs are stacked together in a BATCH, the BATCH is placed in the card reader. There are two terminal commands which may start running the cards: BATCH : All printouts will appear at the terminal from which the command has been given. BATCH "<LPT": All printouts appear on the line printer. The card run is now fully automatic. If the programs contain faults and cannot be run within a pre-determined time limit, e.g., 60 seconds, the next job will be input automatically. It should be noted that all other terminals and peripheral equipment are not affected by the BATCH run, but continue undisturbed. Two types of line marking cards may be used in RC COMAL, the BATCH-BASIC card (HP-standard) and a newly designed RC COMAL card. The new card contains all the types of RC COMAL statements. Both these cards are shown on the next page.\f Page 20 (2 cards)\f 7 Systems with floppy discs RC COMAL contains software for handling FLOPPY DISCS. The floppy disc has three primary fields of application: 1. System storage (e.g. RC COMAL) 2. Program storage 3. Data files. When an RC 7000 SYSTEM is provided with a floppy disc, it would be natural to use this for system start. This gives an easyand convenient system start, which takes about 30 seconds. The main application of the disc would probably be for program storage. Programs are stored and called by means of a name of up to eight characters. The number of programs which can be stored depends on diskette"s capacity. Finally, the disc may contain data files. Reading and printing of data files may be carried out directly from the individual program. A new concept in connection with the floppy disc is the LOGICAL DISC. Before a disc plate is used for the first time, it must be formatted, i.e., divided into a number of sub-sections called logical discs. The number of logical discs is dependent only on the size of the individual logical discs that make up the whole disc. In prac- tical applications, the number may vary from 1 to about 70 logical discs. The formatted disc plate looks as follows: Disc plate formatted into logical discs (LD) Logical disc LD LD LD Sub-indexes Main index \f The main index describes the logical discs. This index contains information on names of the logical discs, protection keys, the length of the logical disc and the number of users. The contents of the main index will not be readily accessible to "lay" users, but can be written out by means of a special program. The sub-indexes contain information on the content of the logical discs. The primary information in the index is the names of the stored files (data files and programs) and their length. Any user may be connected to a logical disc. In order to have access to a logical disc the user must know the name of the logical disc and this gives the user the right to read the files stored on it. If the user wishes to write on the logical disc, then in addition to the name he must give the protection key, which is a number in the interval 0 to 65535. There are a number of terminal commands connected with the use of the floppy disc. CONNECT : Used for connecting the user to a logical disc. After CONNECT follows the name of the logical disc and protection key, if any. E.g., CONNECT "DISC 1", 637. COPY : Used for copying files from one logical disc to another. LOCK : Used from the master terminal to bar the connection of users to the floppy disc. LOOKUP : Prints out information from the sub-index in the connectedlogical disc. This includes the printout of the names of all the files. RELEASE : Disconnects the terminal from the logical disc. USERS : Prints out the number of users connected to the floppy disc. There are a number of RC COMAL statements connected with the use of data files by programs. These are as follows: CREATE, DELETE, RENAME, OPEN FILE, CLOSE FILE, INPUT FILE, PRINT FILE, READ FILE, WRITE FILE, EOF (END OF FILE), MAT INPUT FILE, MAT PRINT FILE, MAT READ FILE, MAT WRITE FILE. These statements are not explained in this publication, but further information may be obtained about them from the "RC COMAL PROGRAMMING GUIDE".\f 8 Summary of RC COMAL This summary provides, a brief though total picture of RC COMAL. Naturally the summary cannot contain all features, and therefore, further references should be made to the "RC COMAL PROGRAMMING GUIDE". In the summary, the following abbreviations and symbols are used: <var> : The name of a numeric variable or the name of a procedure. <svar> : The name of a text string (alphanumeric variable). <expr> : Numeric, Boolean or alphanumeric expression. <slit> : Alphanumeric constant, e.g., "PETER". <val> : Numeric constant. <lno> : Line numbers. <statements> : One or more RC COMAL statements. <ldnames> : The name of a logical disc. <filename> : The name of a disc file or of a peripheral unit. <device> : The name of a peripheral unit. <file> : The number of a user file. <array> : Indicates a dimensioned variable. <comment> : Comments. <mvar> : The name of a matrix. <recl> : Record length. <recno> : Record number. Indicates that one of the possibilities shown may be selected. Indicates that the contents may be omitted. \f 8.1 RC COMAL statement types F_o_r_m_a_t_/_D_e_s_c_r_i_p_t_i_o_n_ CASE <expr> OF <statements-0> WHEN <expr> ,<expr> ... <statements-1> . . . WHEN <expr> ,<expr> ... <statements-n> ENDCASE <comment> The expression following CASE is evaluated and compared - with the expressions following WHEN. If there is a match in the ith WHEN statement, statements-i is executed. If no match is found, statements-0 is executed. Control is then transferred to the first statement following ENDCASE. CHAIN <filename> THEN GOTO <lineno.> Runs the SAVEd program referred to by a filename when the statement is encountered in the user"s program. When used as a command, CHAIN will LOAD, but not execute, the SAVEd program. <val> ,<val> DATA <slit> ,<slit> ... Provides values to be read into variables appearing in READ or MAT READ statements. DEF FN<a>(<d>) = <expr> Used with the f_u_n_c_t_i_o_n_ FNa(d) to define a user function. DELAY = <expr> Interrupts program execution for a specified number of seconds. \f <svar>(<m>) <svar>(<m>) DIM <array>(<m>) ,<array>(<m>) ... <array>(<row>,<col>)<array>(<row>,<col>) Defines the size of string variables or numeric variable arrays. END <comment> Terminates execution of the program. EXEC <name> Executes a procedure defined by PROC-ENDPROC. FOR <control var> = <expr1> TO <expr2> STEP <expr3> <statements> NEXT <control var> FOR begins a FOR-NEXT loop and defines the number of times a block of statements is to be executed. NEXT is the last statement in the loop and changes the value of the control variable. GOSUB <lno> . . . <statements> RETURN <comment> GOSUB transfers control to the first statement of a sub- routine. RETURN is the last statement in a subroutine and returns control to the first statement following the GOSUB statement that called the subroutine. GOTO <lno> Transfers control unconditionally to a statement not in normal sequential order. IF <expr> THEN <statement> Executes a single statement depending on whether an expression is true or false. \f IF <expr> THEN DO <statements> ENDIF <comment> Executes a block of statements depending on whether an - expression is true or false. IF <expr> THEN DO <statements-1> ELSE <comment> <statements-2> ENDIF <comment> Executes statements-1 if an expression is true, other- wise statements-2. <var>,<var> INPUT <slit-0>, <svar> ,<slit-n> ,<svar> ... Assigns values entered from the user"s terminal to numeric or string variables. <var><var> LET <svar> = <expr> ; <svar> = <expr> ... Assigns the value of an expression to a variable. ON ERR THEN <statement> Enables the programmer to take special action, if an error occurs during program execution. ON ESC THEN <statement> Enables the programmer to take special action, if the ESCape key is pressed during program execution. GOTO ON <expr> THEN GOSUB <lno> ,<lno> ... Transfers control to one of several lines in a program depending on the computed value of an expression when the statement is executed. \f T_<expr> <expr> ; <slit> , <sli Figure 1. RC 3751 Flexible Disc Drive. (Showing diskette Door open) O_p_e_r_a_t_o_r_'_s_ _C_o_n_t_r_o_l_s_ 1. DISKETTE DOOR - This door is opened by pressing the push bar (4) inwards and is closed by pressing the latch (2) downwards. 2. LATCH - When pressed downwards this closes the door. RCSL No 42-i 1378\f RESTORE <lno> Resets the data element pointer to the beginning of the data list or to a particular DATA statement. STOP <comment> Terminates execution of the current program. TAB(<expr>) Used in PRINT statements to tabulate the printing posi- tion to the column number evaluated from an expression. WHILE <expr> THEN DO <statements> ENDWHILE <comment> Executes a block of statements repetitively while an ex- pression is true. If the expression is false the first time WHILE is encountered, the block of statements is not executed even once. 8.2RC COMAL standard functio\f FN<a>(<d>) A user function which is defined by DEF and returns a numeric value. INT(<expr>) Returns the value of the nearest integer not greater than an expression. LOG(<expr>) Calculates the n_a_t_u_r_a_l_ logarithm of an expression. RND(<expr>) Produces a pseudo random number between 0 and 1. SGN(<expr>) Returns the algebraic sign of an expression. SIN(<expr>) Calculates the sine of an angle which is expressed in radians. SQR(<expr>) Computes the square root of an expression. SYS(<expr>) Returns system information, based on an expression which is evaluated to an integer, as follows: 0 Time of day. 1 Day. 2 Month. 3 Year. 4 Terminal port number. 5 Time used since terminal was logged on. 6 Number of file I/O statements executed. 7 Error code of last run-time error. 8 File number of last file referenced . \f 9 Page size. 10 Tab size. 11 Hour. 12 Minutes past last hour. 13 Seconds past last minute. 14 Constant (3.14159) 15 Constant e (2.71828). TAN(<expr>) Calculates the tangent of an angle which is expressed in radians. 8.2.1Functions for processing text strings CHR(<expr>) T_ Returns the character corresponding to the number found as an expression modulo 128. <svar> LEN( <slit> ) &_Returns the current number of characters in a string. <svar> ORD( <slit> ) Returns the decimal number of the first character of a string. 8.3Matrix operations in RC COMAL MAT <mvar1> = <mvar2> Copies the elements of one matrix to another matrix. MAT <mvar1> = <mvar2> UUU+DDD <mvar 3> UUUU-DDDD Performs the scalar addition or subtraction of two matrices.\f MAT <mvar1> = UUU<mvar2>DDD * <mvar3> UUUU(<expr>)DDDD Performs the multiplication of one matrix by another matrix or by a scalar. <var> = DET(<expr>) Returns the determinant of the last matrix inverted by a MAT INV statement. MAT <mvar> = CON Initializes a matrix such that all elements are set to one. MAT <mvar> = IDN Initializes a matrix such that all elements (i,i) are set to one and the remaining elements are set to zero. MAT INPUT <mvar1> ,<mvar2>, ... ,<mvar-n> Assigns numeric values entered from the user"s terminal to the elements of one or more matrices. MAT <mvar1> = INV(<mvar2>) Inverts a matrix and assigns the resultant element values to another matrix. ; MAT PRINT <mvar> , mvar> ... ; Outputs the values of the elements of one or more matrices on the user"s terminal. MAT READ <mvar> ,<mvar> ... Reads in numeric values from DATA statements and assigns the values to the elements of one or more matrices. \f MAT <mvar1> = TRN(<mvar2>) Transposes a matrix and assigns the resultant element values to another matrix. MAT <mvar> = ZER Initializes a matrix such that all elements are set to zero. T_ 8.4Commands to logical discs CONNECT <ldname> ,<expr> Connects the user"s terminal to a logical disc for reading or, if the protection key is correctly specified, for both &_reading and writing. COPY "<ldname>:<filename1>","<filename2>" Copies a file (<filename1>) from any logical disc (<ldname>) to a file (<filename2>) in the logical disc to which the terminal is connected. INIT <device> Initializes the main catalog in a device containing logical discs. LOCK <device> Locks a device, when changing discs or closing down the system, so that no user can connect his terminal to a logical disc in that device. LOOKUP "LPT" Returns a listing of the files in the logical disc to which the terminal is connected. RELEASE Disconnects the user"s terminal from the logical disc to which it is connected.\f USERS <device> Returns the number of users whose terminals are connected to any logical disc in a device. 8.5Statements for file processing CLOSE FILE(<file>) Dissociates a filename and a user file number (see OPEN FILE) so that the file no longer can be referenced. The CLOSE form of the statement closes all open files. CREATE <filename>,<size>,<recl> Creates a file in the logical disc to which the user"s terminal is connected. DELETE <filename> Deletes a file in the logical disc to which the user"s terminal is connected. EOF(<file>) Returns a value of +1, if an end of file condition was detected in the last INPUT FILE or READ FILE statement; otherwise, a value of 0 is returned. <var><var> INPUT FILE(<file>) , <svar> , <svar> ... Reads data in ASCII format from a sequential access file for the variables in the argument list. MAT INPUT FILE(<file>) , <mvar> ,<mvar> ... Reads data in ASCII format from a sequential access file for the matrix variables in the argument list. MAT PRINT FILE(<file>) , <mvar> ,<mvar> ... Writes matrix data in ASCII format to a sequential access file.\f MAT READ FILE(<file>,<recno>) , <mvar> ,<mvar> ... Reads data in binary format from a sequential access file or record of a random access file for the matrix variables in the argument list. MAT WRITE FILE(<file>,<recno>) , <mvar> ,<mvar> ... Writes matrix data in binary format to a sequential access file or record of a random access file. OPEN FILE(<file>,<mode>) , <filename> Associates a filename, i.e. a disc file or a device, with a user file number so that the file can be referenced in other file I/O statements; also specifies how the file is to be used. <expr> , <expr> , PRINT FILE(<file>) , <slit> ; <slit> ... ; <svar> <svar> Writes data in ASCII format to a sequential access file. <expr> <expr> PRINT FILE(<file>) , USING <format>, <slit> , <slit> ... , <svar> ; <svar> ; Writes data in ASCII format to a sequential access file, using a specified output format. <var><var> READ FILE(<file>,<recno>) , <svar> , <svar> ... Reads data in binary format from a sequential access file or record of a random access file for the variables in the argument list. RENAME <filename1>,<filename2> Renames a file in the logical disc to which the user"s terminal is connected. \f <expr> <expr> WRITE FILE(<file>,<recno>) , <slit> , <slit> ... <svar> <svar> Writes data in binary format to a sequential access file or record of a random access file. 8.6 System commands in RC COMAL <lno n1>,<lno n2> <lno n1> <lno n1>, ,<lno n2> Deletes one or more statements in a program. <lno n1> STEP AUTO , <lno n2> STEP <lno n1> , <lno n2> Provides automatic line numbers in a program, thereby making it easier to enter programs from a terminal. BATCH "<LPT" Places the terminal in batch mode and causes the system to start reading cards from the mark-sense card reader. Job output will appear on the terminal or, if the BATCH "<LPT" form of the command is used, on the line printer. BYE T_ Logs the terminal off the system. CON &_ CONL Continues execution of the current program after the execution of a STOP statement in the program, after the ESCape key has been pressed, or after an error has occurred. Output from PRINT statements will appear on the terminal or, if the CONL form of the command is used, on the line printer.\f ENTER <filename> Merges the statement lines from the disc file or the device specified by a filename into the current program storage area. <lno n1> TO LIST , <lno n2> <filename> TO <lno n1> , <lno n2> Outputs part or all of the currently loaded program in ASCII format to the disc file or the device specified by a filename or, if no filename is specified, to the terminal. LOAD <filename> Loads a previously SAVEd program in binary format from the disc file or the device specified by a filename into the user"s program storage area. NEW Clears all currently stored program statements and variables from core memory and closes any open files. PAGE=<expr> Sets the right-hand margin of the terminal. <lno n1> TO PUNCH , <lno n2> TO <lno n1> , <lno n2> Outputs part or all of the currently loaded program in ASCII format to the terminal punch (when present). \f <lno n1> STEP RENUMBER , <lno n2> STEP <lno n1> , <lno n2> Renumbers the statements in the current program. RUN <lno> RUNL <filename> Executes the current program, either from the lowest numbered statement or from a specified line number, or loads and executes a previously SAVEd program as the current program. Output from PRINT statements will appear on the terminal or, if the RUNL form of the command is used, on the line printer. SAVE <filename> Writes the currently loaded program, including the current values of all variables and parameters, in binary format to the disc file or the device specified by a filename. SIZE Returns the number of bytes used by the current program and the numbers of bytes left. TAB=<expr> Sets the zone spacing between the print elements output by PRINT statements. 8.7 Commands in connection with batch runs EOJ Terminates a job. SCRATCH <text> Initiates a job. TIME=<val> Specifies how may seconds a job may run.If nothing is specified, TIME = 60 seconds.\f RC COMAL - EN KORT INTRODUKTION Første udgave A/S REGNECENTRALEN Februar 1978 Informationsafdelingen RCSL 42-i 0779\f Forfatter: Thorkild Maaetoftog Børge Christensen Tekstredaktør: Inga Marcussen NØGLEORD: RC 7000, RC 3600, RC COMAL, BASIC, INTRODUKTION, Kortfattet sprogoversigt. ABSTRACT: Denne introduktion beskriver de udvidelser, i forhold til almindeligt anvendt BASIC, som er implementeret i RC COMAL. Desuden beskrives specielt anvendelse af floppy disc samt kortlæser. Sidste kapitel er en total oversigt over RC COMAL. BEM@RKNING: Udgivet af A/S Regnecentralen, i samarbejde med Dataafdelingen ved Tønder Statsseminarium. Brugere osv. Copyright A/S Regnecentralen, 1978 Tryk: A/S Regnecentralen, København \f INDHOLDSFORTEGNELSE 1 HVAD ER RC COMALSide 5 2 VARIABELNAVNE7 2.1 Variabeltildeling7 3 AVANCEREDE STYRESTRUKTURER8 3.1 If p THEN .. ELSE .. ENDIF8 3.2 If p THEN .. ENDIF9 3.3 REPEAT .. UNTIL p10 3.4 WHILE p DO .. ENDWHILE11 3.5 CASE udtr OF .. WHEN .. ENDCASE12 3.6 Procedurer14 4 OPERATORER16 4.1 Boolske udtryk16 5 TERMINALKOMMANDOER18 6 SYSTEMER MED KORTL@SER19 7 SYSTEMER MED FLEXIBLE DISC21 8 OVERSIGT OVER RC COMAL23 8.1 RC COMAL sætningstyper24 8.2 RC COMAL standardfunktioner28 8.2.1 Funktioner til behandling af tekststrenge30 8.3 Matrix operationer i RC COMAL30 8.4 Kommandoer til logiske disce31 8.5 Sætninger til fil-behandling32 8.6 Systemkommandoer i RC COMAL34 8.7 Kommandoer i forbindelse med batch-kørsel36\f 1 Hvad er RC COMAL Regencentralen har siden 1970 markedsført RC 7000 Minidatamat- systemet, primært til undervisningsinstitutioner. RC 7000 er en ren dansk datamat, idet såvel hardware som software udvikles og produceres i Danmark af Regnecentralen. Programmeringssproget COMAL blev defineret af lektor Benedict Løfstedt, Århus Universitet, og lektor Børge Christensen, Tønder Statsseminarium. Sproget indeholder extended basic som en ægte delmængde. En første version af COMAL blev udviklet på en RC 7000 af Per Christiansen og Knud Christensen ved Tønder Statsseminariums dataafdeling, i 1975. Mere end tre års erfaringer med COMAL ved undervisning i datalære ved bl.a. gymnasier, på seminarier og i folkeskoler har vist, at COMAL er l_e_t_t_e_r_e_ _a_t_ _l_æ_r_e_ end BASIC. Dette bl.a. fordi det giver anledning til programmer, som har en k_l_a_r_e_r_e_ _o_p_b_y_g_n_i_n_g_ og derfor er n_e_m_m_e_r_e_ _a_t_ _l_æ_s_e_ end tilsvarende BASIC-programmer. Ved en gennemlæsning af denne introduktion til RC COMAL vil læseren forstå, hvorfor det forholder sig således. RC COMAL er den endelige version af COMAL-sproget og er udviklet af A/S Regnecentralen i stadig samarbejde med lærere fra semi- narier, gymnasier og folkeskoler. RC COMAL indeholder væsentlige forbedringer i forhold til det oprindeligt definerede COMAL, og disse forbedringer tager alle sigte på at gøre sproget til et let og smidigt redskab for undervisningen i de almene skoleformer. COMAL er iøvrigt en forkortelse for: C_O_M_mon A_lgorithmic L_anguage (Almindeligt algoritmesprog). Ved definitionen af sproget er der lagt stor vægt på, at de grundlæggende a_l_g_o_r_i_t_m_e_s_t_r_u_k_t_u_r_e_r_ skal være lette at beskrive og lette at genkende. Denne introduktion er ikke ment som en lærebog i RC COMAL. Introduktionen er skrevet for læsere, som kender de vigtigste sprogelementer i BASIC, og indeholder derfor ikke definitioner eller forklaringer på de mest simple RC COMAL/BASIC sætninger. Bogen indeholder først en beskrivelse af udvidelser og nye sprog- elementer i RC COMAL i forhold til BASIC. Sidste kapitel er en totaloversigt, i skematisk form, over RC COMAL. \f Yderligere litteratur om RC COMAL: "RC COMAL Programming Guide", udgivet af A/S Regnecentralen. Børge Christensen: "RUN COMAL", udgivet af Studentlitteratur. Børge Christensen: Opgaver til "RUN COMAL", samme udgiver.\f 2 Variabelnavne I RC COMAL navngives variable af alle typer efter forskriften: t t ....... t , i 1 8, hvor t er et bogstav, mens t , ....... t er bogstaver ellercifre. E_x_e_m_p_l_e_r_ LET RENTE = KAPITAL * RENTEFOD * ANTDAGE/360/100 LET NAVN< = "OLE OLSEN" LET TABEL (NUMMER, AARG) = 126 2.1 Variabeltildeling I RC COMAL kan LET-sætninger indeholde mere end n tildeling: LET var = udtr ; var = udtr ; .....; var = udtr hvor var , var , ....., var er variabelnavne, ....., mens udtr , udtr , ....., udtr er konstanter, variable eller formler. En LET-sætning kan indeholde så mange tildelinger, som linielængden tillader. E_x_e_m_p_l_e_r_ LET RENTEFOD = 12; KAPITAL = 15000; NAVN< = "OLE OLSEN" Denne sætning har samme virkning som tre på hinanden følgende LET sætninger med hver sin tildeling. \f 3 Avancerede styrestrukturer Ud over styrestrukturerne i BASIC findes følgende i RC COMAL: (1) IF p THEN .. ELSE .. ENDIF (2) IF p THEN .. ENDIF (3) REPEAT .. UNTIL p (4) WHILE p DO .. ENDWHILE (5) CASE udtr OF .. WHEN .. ENDCASE 3.1 IF p THEN .. ELSE .. ENDIF Strukturen er opbygget således: IF p THEN A f s ELSE p B A B ENDIF p er et Boolsk udtryk (et åbent udsagn); hvis p har værdien "sand", udføres den programdel A, som er beskrevet mellen IF p THEN og ELSE, og hvis p har værdien "falsk", udføres den program- del B, der er beskrevet mellem ELSE og ENDIF. Når enten A eller B er udført, går udførelsen af programmet videre med sætningen efter ENDIF. Den del af programteksten, som ligger mellem styresætningerne, indrykkes, når der udskrives en programliste (jvf. FOR .. NEXT i BASIC). \f E_k_s_e_m_p_l_e_r_ IF PRIS < 100 THEN PRINT "DE SKAL BETALE (INCL. GEBYR): "; PRIS + 15; "KR." ELSE PRINT "DE SKAL BETALE: "; PRIS; "KR." ENDIF INPUT "KARAKTER: ", KARAK LET SUM = SUM + KARAK; ANTKAR = ANTKAR + 1 IF KARAK < MIN THEN LET N@STMIN = KARAK ELSE IF KARAK < N@STMIN THEN LET N@STMIN = KARAK ENDIF 3.2 IF p THEN .. ENDIF Strukturen er opbygget således: s IF p THEN p A f ENDIF A p er et Boolsk udtryk; hvis p har værdien "sand", bliver det programafsnit A, som er beskrevet mellem IF p THEN og ENDIF, udført, og hvis p har værdien "falsk", overspringes A. I begge tilfælde fortsættes udførelsen af programmet med sætningen efter ENDIF. Den tekst, som står mellem IF p THEN og ENDIF bliver indrykket, når der udskrives en programliste. I et RC COMAL-program må man have op til syv IF p THEN .. (ELSE) .. ENDIF forgreninger inden i hinanden. \f E_k_s_e_m_p_l_e_r_ READ TAL1, TAL2 IF TAL1 > TAL 2 THEN LET BUFFER = TAL1; TAL1 = TAL2; TAL2 = BUFFER ENDIF PRINT TAL1, TAL2 _ _ _ _ _ _ _ IF RND (0) < 3/10 THEN LET H1 = H1 + 1 ELSE IF RND (0) < 3/9 THEN LET H2 = H2 + 1 ELSE IF RND (0) < 3/8 THEN LET H3 = H3 + 1 ELSE IF RND (0) < 3/7 THEN LET H4 = H4 + 1 ELSE LET H5 = H5 + 1 ENDIF ENDIF ENDIF ENDIF 3.3 REPEAT .. UNTIL p Strukturen er opbygget således: REPEAT A A f p UNTIL p s p er et Boolsk udtryk; det programafsnit A, som er beskrevet mellem REPEAT og UNTIL p, bliver gentaget indtil p har værdien "sand". Når p antager denne værdi, fortsættes udførelsen af programmet med sætningen efter UNTIL p. Det bør bemærkes, at programafsnittet A udføres mindst n gang når fortolkeren når REPEAT-sætningen, fordi styringen af løkken sker fra UNTIL-sætningen. Teksten mellem REPEAT og UNTIL p bliver indrykket, når der udskrives en programliste. \f 3.4 WHILE p DO .. ENDWHILE Strukturen er opbygget således: WHILE p DO s A p A ENDWHILE f p er et Boolsk udtryk; det programafsnit A, som er beskrevet mellem WHILE p DO og ENDWHILE bliver gentaget, så længe p har værdien "sand". Når p har værdien "falsk", fortsættes program- udførelsen med sætningen efter ENDWHILE. Det kan bemærkes, at hvis p har værdien "falsk", når udførelsen af programmet når til WHILE-sætningen, bliver afsnittet A slet ikke udført, men fortolkeren fortsætter uden videre med sætningen efter ENDWHILE. Teksten mellem WHILE p DO og ENDWHILE indrykkes, når der skrives en programliste. I RC COMAL kan man have op til syv REPEAT .. UNTIL-løkker og op til syv WHILE .. ENDWHILE-løkker inden i og u_a_f_h_æ_n_g_i_g_ af hinanden. Man kan altså f.eks. have ialt 14 løkker af de to typer inden i hinanden, uafhængig af rækkefølge, blot 7 af dem er REPEAT-løkker og de øvrige WHILE-løkker. Den fra BASIC arvede FOR .. NEXT-løkke har ingen indflydelse på det antal REPEAT- og WHILE-løkker, man kan have inden i hinanden (i RC COMAL kan man for øvrigt have op til syv FOR .. NEXT-løkker inden i hinanden). Antallet af IF .. (ELSE) .. ENDIF-forgreninger er også uafhængig af eventuelle indlejrede løkker. Man kan altså faktisk have ialt 21 løkker + 7 forgreninger indbygget i hinanden i et RC COMAL-program. Forfatteren mindes dog ikke at have set dette i praksis. E_k_s_e_m_p_l_e_r_ INPUT "DE TO TAL:", A, B LET X = A; Y = B REPEAT (* EUKLID*) LET REST = X MOD Y LET X = Y; Y = REST UNTIL REST = 0 PRINT "SFD FOR"; A; "OG"; B; "ER"; X _ _ _ _ _ _ _ \f INPUT "NAVN (EFTERNAVN FORNAVN): ", NAVN< WHILE NAVN< <> "SLUT" DO INPUT "ADRESSE:", ADR< INPUT "BY (POSTNR BYNAVN): ", BY< INPUT "N@STE NAVN: ", NAVN< ENDWHILE B_e_m_æ_r_k_n_i_n_g_ Brugeren af GOTO-sætninger i forbindelse med styrestrukturerne (1) - (4) kan være problematisk. I almindelighed bør man ikke bruge GOTO"er i programafsnittene A og B, og helt bestemt ikke, hvis disse GOTO-sætninger henviser til sætninger, som ligger uden for de sætninger, som indleder eller afslutter de nævnte programafsnit. Brugeren af GOTO bør i det hele taget forbeholdes usædvanlige situationer (f.eks. i tilfælde af fejl i inddata m.m.). 3.5 CASE udtr OF .. WHEN .. ENDCASE Strukturen er opbygget således: CASE udtr OF A WHEN <liste>DD1UU ADD1UU case..of WHEN <liste>DD2UU A A1 A2 . . . An ADD2UU . . . WHEN <liste>DDnUU ADDnUU ENDCASE u_d_t_r_ er et aritmetisk udtryk (en konstant, en variabel eller en formel), en af de Boolske konstanter TRUE eller FALSE, eller en strengvariabel, og <l_i_s_t_e_> , er en liste af aritmetiske udtryk, en liste af Boolske udtryk eller en liste af tegnfølger. \f Når værdien af u_d_t_r_ er udregnet, søger fortolkeren i listerne efter de forskellige WHEN, efter en størrelse, der har samme værdi, som u_d_t_r_. Hvis en sådan størrelse findes i <liste> , bliver det efterfølgende programafsnit A udført, og derefter fortsættes programudførelsen med sætningen efter ENDCASE. Hvis den relevante størrelse ikke findes, udføres det alternative afsnit A, som står anført umiddelbart efter CASE-sætningen, og derpå fortsættes med sætningen efter ENDCASE. Antallet af WHEN-sætninger efter en forelagt CASE-sætning er ubegrænset, og man kan have så mange CASE .. ENDCASE inden i hin- anden, som man ønsker. Teksterne til A, A , A , ... A indtrykkes i forhold til CASE-, WHEN- og ENDCASE-sætningerne, når der udskrives en programliste. E_k_s_e_m_p_l_e_r_ INPUT "1 = IND, 2 = LISTE, 3 = SØG, 4 = SLET, 5 = STOP:", JOBKODE CASE JOBKODE OF PRINT "DEN KODE FINDES IKKE." WHEN 1 REM (*NYE KODER INDSKRIVES*) EXEC INDKODER WHEN 2 REM (*UDSKRIFT AF KODELISTE*) EXEC UDSKRIFT WHEN 3 REM (*SØG EN GIVEN KODE*) EXEC SØGNING WHEN 4 REM (*SLET EN GIVEN KODE*) EXEC SLETKODE WHEN 5 REM (*FYRAFTEN*) STOP ENDCASE _______ INPUT SVAR< CASE SVAR< OF PRINT "LÆS INSTRUKTIONEN ORDENTLIG" WHEN "JA" EXEC RUDE1 WHEN "NEJ" EXEC RUDE2 WHEN "INGEN", "INTET", "IKKE NOGET" EXEC RUDE3 ENDCASE _______\f INPUT "KOEFFICIENTERNE A, B OG C:", A, B, C IF A <> 0 THEN LET DETM = B* B-4* A*C CASE TRUE OF WHEN DETM > 0 LET X1 = (-B+SQR (DETM))/2/A; X2 = (-B-SQR (DETM))/2/A PRINT "X1 ="; X1, "X2 =; X2 WHEN DETM = 0 LET X = -B/2/A PRINT "DOBBELTROD: X ="; X WHEN DETM <0 PRINT "INGEN REELLE RØDDER". ENDCASE ELSE PRINT "JEG TROEDE, VI SKULLE LØSE ANDENGRADSLIGNINGER?" ENDIF 3.6 Procedurer Man kan med stor fordel benytte sig af procedurer til at gøre sit program overskueligt og logisk i opbygningen. RC COMAL har derfor også en udvidelse på dette felt. Hvis et program inledes med sætningen PROC <navn> hvor <navn> er en tegnfølge, der har samme format som et variabel- navn (jvf. afsnit 2), og afsluttes med sætningen ENDPROC kan dette program kaldes som et underprogram af et andet program ved brug af sætningen EXEC <navn> Når underprogrammet er blevet udført, fortsætter fortolkeren med den sætning, der følger lige efter den EXEC-sætning, fra hvilket opkaldet til underprogrammet skete. \f Vi kan illustrere det således: ... EXEC <navn> ... END (*HOVEDPROGRAM SLUT*) ... PROC <navn> underprogr. ENDPROC Fra et underprogram kan man kalde et nyt underprogram, og således videre til en dybde af ialt syv. Fænomenet afgiver følgende billede: PROC <navn > PROC <navn > PROC <navn > ... ... ... EXEC <navn > EXEC <navn > EXEC <navn > ... ... ... ENDPROC ENDPROC ENDPROC \f 4 Operatorer Udover de sædvanlige aritmetiske og logiske operatorer indeholder RC COMAL følgende faciliteter: DIV : Heltalsdivision, eks. 11 DIV 4 (=2) MOD : Modulus, eks. 11 MOD 4 (=3) AND : Logisk "OG", eks. (A>10) AND (A<20) OR : Logisk "ELLER", eks. (A<20) OR (A>30) NOT : Logisk negation, eks. NOT (A<10) Mens de to første, DIV og MOD, er en bekvem og logisk udvidelse af de aritmetiske operatorer, giver de sidste tre (AND, OR og NOT) en række specielle anvendelser i forbindelse med Boolske udtryk, hvilket skal belyses nærmere. 4.1 Boolske udtryk I RC COMAL kan man danne Boolske udtryk i sædvanlig Boolsk algebra under benyttelse af operatorerne AND, OR og NOT. E_k_s_e_m_p_l_e_r_ IF MAXNR = 0 OR SIDSTE = 10 THEN UNTIL NAVN< = "NONE" OR SLUT = TRUE WHILE SQR (OBS) <> 25 AND OBS <> 0 DO UNTIL NODE = TRUE AND H(NODE) = 0 OR H(NODE) = SIDST I RC COMAL kan numeriske variable anvendes som (pseudo) Boolske variable, idet en numerisk variabel i rette sammenhæng opfattes som en Boolsk variabel med værdien "falsk", hvis den pågældende numeriske variable har talværdien 0, og værdien "sand" i alle andre tilfælde. "Sand" svarer altså til "forskellig fra 0" mens "falsk" svarer til "lig med 0". For at gøre det lettere at huske denne ækvivalens, kan man i RC COMAL indføre konstanterne TRUE og FALSE, der har talværdierne hhv. 1 og 0. \f E_k_s_e_m_p_l_e_r_ Når sætningen LET GÅOP = TRUE er udført, har GÅOP værdien 1 og bliver derfor i denne sætning IF GÅOP THEN PRINT "DIVISIONEN GÅR OP" fortolket som en Boolsk variabel med værdien "sand". På grund af den nævnte ækvivalens mellem talværdier og sandheds- værdier, kan man anvende Boolske udtryk i aritmetiske udtryk. Et Boolsk udtryk, som har værdien "sand", bliver i denne sammenhæng tolket som et aritmetisk udtryk med værdien 1, mens et Boolsk udtryk, som har værdien "falsk", får tillagt talværdien 0. E_k_s_e_m_p_l_e_r_ I sætningen DEF FNF (X) = (X<0) * (X+1) + (X=0) * X+(X>0) * (2*X+3) er funktionen FNF givet efter en "opdeling afdefinitionsmængden". Hvis LUKKET og HUNDLØS er variable med værdierne hhv. 1 (TRUE) og 0 (FALSE), vil udførelsen af sætningen LET IND = LUKKET AND NOT HUNDLØS bevirke, at den variable IND får tildelt værdien 1 (TRUE). \f 5 Terminalkommandoer En række nye terminalkommandoer udover de almindelige (RUN, LIST osv.) er tilføjet RC COMAL. Følgende skal omtales: AUTO : Anvendes ved indtastning af programmer. Kommandoen starter automatisk generering af linienumre: 10, 20, 30, ...... osv. RUNL : Starter udførelsen af et program ligesom RUN, men alle udskrifter vil komme på linieskriveren. CON : Starter et program fra det sted, det sidst blev standset. Programmet kan standses ved hjælp af en STOP-sætning, tryk på ESC-tast o.l. CONL : Som CON, men fortsætter med udskrift på linieskriveren. BATCH :Starter indlæsning af programmer fra kort- læseren. BATCH "<LPT": Som BATCH, men med udskrift på linieskriver.\f 6 Systemer med kortlæser , RC 7000 systemer med kortlæser giver mulighed for afvikling af BATCH-kørsler, dvs. automatisk kørsel af f.eks. en hel klasses programmer. Kortene pakkes i JOB (JOB = program + styrekort) og de forskellige JOB pakkes sammen til en BATCH (BATCH = bunke). Hvert JOB forsynes f.eks. med følgende styrekort: 1. SCRATCH <tekst>, hvor <tekst> udskrives før output fra programmet. 2. LIST, udskriver programmet. 3. RUN, starter programudførelsen. 4. EOJ, (E_nd-O_f-J_ob) afslutter det enkelte job. Når de enkelte JOB er sammenpakket til en BATCH, anbringes kortstakken i kortlæseren. Der fines to terminalkommandoer, som kan starte kørslen af kortene: BATCH : Alle udskrifter vil fremkomme på terminalen, hvorfra kommandoen er afgivet. BATCH "<LPT": Alle udskrifter fremkommer på linieskriveren. Kortkørslen sker nu fuldautomatisk. Såfremt programmerne inde- holder fejl, så de ikke kan køres inden for en nærmere fastlagt tidsgrænse, f.eks. 60 sek., vil næste job automatisk blive indlæst. Det skal bemærkes, at alle øvrige terminaler og ydre enheder ikke påvirkes af BATCH-kørslen, men fortsætter uhindret. I RC COMAL kan anvendes to typer stregmarkeringskort, nemlig BATCH-BASIC kortet (HP-standard) samt et nydesignet RC COMAL kort. Det nye kort indeholder samtlige RC COMAL sætningstyper. \f Side 19 (2 kort)\f 7 Systemer med flexible disc I RC COMAL findes programmel til håndtering af FLEXIBLE DISC (Floppy Disc). Flexible disc"en har tre primære anvendelsesområder: 1. Systemopbevaring (f.eks. RC COMAL) 2. Programopbevaring 3. Arbejde med datafiler Når et RC 7000 SYSTEM er forsynet med en flexible disc, vil det være naturligt, at denne anvendes ved systemopstart. Dette giver en let og behagelig systemopstart, som er overstået på ca. 30 sek. Hovedanvendelsen af disc"en vil nok være programopbevaring. Programmer opbevares og kaldes ved hjælp af et navn på indtil 8 tegn. Antallet af programmer, som lagres, er kun afhængig af diskettens kapacitet. Endelig kan disc"en indeholde datafiler. Læsning og skrivning af datafiler kan udføres direkte fra det enkelte program. Et nyt begreb i forbindelse med flexible disc er begrebet LOGISK DISC. Inden en diskette (disc-plade) tages i brug første gang, skal denne formatteres, dvs. inddeles i et antal underområder, logiske disce. Antallet af logiske disce er kun afhængig af den enkelte logiske disc"s størrelse. I praksis vil antallet kunne variere fra 1 til ca. 70. Den formatterede diskette ser således ud: Diskette formatteret med logiske disce (LD) Logisk disc LD LD LD Underkataloger Hovedkatalog\f Hovedkataloget beskriver de logiske disce. I kataloget findes oplysninger om navne på de logiske disce, beskyttelsesnøgler, den logiske disc"s længde samt antallet af brugere. Hovedkatalogets indhold vil ikke være umiddelbart tilgængeligt for "menige" brugere, men kan udskrives ved hjælp af et specielt program. e Underkatalogerne indeholder oplysninger om indholdet af de logisk disce. De primære oplysninger i kataloget er navnene på de op- bevarede filer (datafiler og programmer) samt længden på disse. Hver bruger kan tilkoble sig en logisk disc. For at tilkoble sig den logiske disc, skal brugeren kende navnet på den logiske disc, og dette giver brugeren ret til at læse de filer, der opbevares på denne. Hvis brugeren ønsker at skrive på den logiske disc, må han udover navnet anføre beskyttelsesnøglen, som er et tal i intervallet 0 til 65535. I forbindelse med flexible disc findes en række terminalkommandoer: CONNECT: Anvendes til at tilknytte brugeren til en logisk disc. Efter CONNECT anføres navnet på den logiske disc, samt evt. beskyttelsesnøgle. F.eks. CONNECT "DISC 1", 637. COPY : Anvendes til kopiering af filer fra en logisk disc til en anden. LOCK : Anvendes fra masterterminalen til at spærre for til- kobling af brugere til flexible disc"en. LOOKUP : Udskriver oplysninger fra underkataloget i den til- sluttende logiske disc. Bl.a. udskrives navnene på alle filer. RELEASE: Frakobler terminalen fra den logiske disc. USERS : Udskriver antal brugere tilkoblet flexible disc"en. I forbindelse med anvendelse af datafiler i programmer findes en lang række RC COMAL sætninger. Følgende kan anvendes: CREATE, DELETE, RENAME, OPEN FILE, CLOSE FILE, INPUT FILE, PRINT FILE, READ FILE, WRITE FILE, EOF (END OF FILE), MAT INPUT FILE, MAT PRINT FILE, MAT READ FILE, MAT WRITE FILE. Disse sætninger skal ikke belyses nærmere her, men yderligere oplysninger kan fås i "RC COMAL PROGRAMMING GUIDE". \f 8 Oversigt over RC COMAL Denne oversigt giver i kort form et totalt billede af RC COMAL. Oversigten kan naturligvis ikke indeholde alle finesser, og vi må derfor henvise til manualen, hvis man vil søge yderligere information. I oversigten anvendes følgende forkortelser og symboler: <var> : Navnet på en numerisk variabel, eller navnet på en procedure. <svar> : Navnet på en tekststreng (alfanumerisk varia- bel). <udtr> : Numerisk, Boolsk eller alfanumerisk udtryk. <slit> : Alfanumerisk konstant, f.eks. "PETER". <val> : Numerisk konstant. <lnr> : Linienumre. <statements> : En eller flere RC COMAL sætninger. <ldnames> : Navnet på en logisk disc. <filename> : Navnet på en disc file eller på en ydre enhed. <device> : Navnet på en ydre enhed. <file> : Nummeret på en bruger fil. <array> : Angiver en dimensioneret variabel. <comment> : Kommentarer. <mvar> : Navnet på en matrix. <recl> : Record-længde. <recno> : Record-nummer. Angiver at der kan vælges en af de viste muligheder. Angiver at det viste kan udelades. \f 8.1 RC COMAL sætningstyper F_o_r_m_a_t_/_b_e_s_k_r_i_v_e_l_s_e_ CASE <udtr> OF <statements> - 0> WHEN <udtr> , <udtr> ... <statements> - 1 . . . WHEN <udtr> ,<udtr> ... <statements>-n> ENDCASE <comment> udtrykket efter CASE udregnets og sammenlignes med de udtryk, der efterfølger sætninger med WHEN. Hvis der er overensstemmelse i den I"te WHEN-sætning, udføres statements-I. Hvis ingen overens- stemmelse findes, udføres statements-0. Programmet fortsætter efter ENDCASE. CHAIN <filename> THEN GOTO <lnr> Starter et SAVE"d program med navnet <filename>. <val> ,<val> DATA ... <slit> ,<slit> Definerer data til sætningerne READ og MAT READ DEF FN <a>(<d>) = <udtr> Brugerdefineret funktion, som senere kan kaldes som funktionen FNa (d). DELAY = <udtr> Afbryder programudførelsen i et specificeret antal sekunder (udtr). <svar>(<m>) <svar>(<m>) DIM <array>(<m>), , <array>(<m>) ... <array>(<row>,<col>) <array>(<row>,<col>)\f Dimensionerer længden af tekststrenge (svar (m)) længden af en- dimensionale numeriske indicerede variable (array (m)) samt størrelsen af to-dimensionale numeriske indicerede variable (array (r,s)). END <comment> Standser udførelsen af et kørende program. EXEC <name> Udfører proceduren <name>, defineret at PROC-ENDPROC. FOR <control var> = <udtr1> TO <udtr2> STEP <udtr3> <statements> NEXT <control var> FOR starter en FOR-NEXT løkke og definerer antallet af løkkegennemløb. Løkken afsluttes af NEXT. GOSUB <lnr> . . . <statements> RETURN <comment> GOSUB kalder underprogrammet med start i <lnr>. Underprogrammet afsluttes af RETURN og programudførelsen fortsætter umiddelbart efter GOSUB. GOTO <lnr> Programudførelsen fortsætter i linien med linienummer <lnr>. IF <udtr> THEN <statement> Udfører en enkelt sætning (<statement>) afhængig af om <udtr> er sandt eller falsk. IF <udtr> THEN DO <statements> ENDIF Udfører en række sætninger (<statements>) afhængig af om <udtr> er sandt eller falsk. \f IF <udtr> THEN DO <statements-1> ELSE <comment> <statements-2> ENDIF <comment> Udfører <statements-1> hvis <udtr> er sandt, og <statements-2> hvis <udtr> er falsk. <var>,<var> INPUT <slit-0>, ,<slit-n> <svar> ,<var> Tilknytter værdier indtastet fra brugerens terminal til numeriske og alfanumeriske variable. For att lette operatøren kan ledetekster indføjes (<slit>). <var> <var> LET = <udtr> ; = <udtr> ... <svar> <svar> Tildeler værdien af <udtr> til en variabel. ON ERR THEN <statement> Hvis en fejl opstår under programudførelsen, udføres <statement>. ON ESC THEN <statement> Hvis der trykkes på ESC-tasten under programudførelse, udføres <statement>. GOTO ON <udtr> THEN <lnr> ,<lnr> ... GOSUB Programudførelsen fortsætter i et af de i listen specificerede linienumre, afhængig af den udregnede værdi af <udtr>. <udtr> <udtr> ;<slit> , <slit> , PRINT <svar> ; <svar> ... ; Udskriver det i sætningen specificerede på brugerens terminal. \f <udtr> <udtr> PRINT USING <format> , <slit> , <slit> ... , <svar> ; <svar> ; Udskriver det i sætningen specificerede i et brugerdefineret format (<format>). PROC <var> <statements> ENDPROC <comment> Definerer en procedure. Når proceduren kaldes af EXEC, fortsætter programudførelsen i første linie efter PROC. ENDPROC er sidste linie i proceduren, og programudførelsen fortsætter derefter umiddelbart efter den EXEC-sætning, som kaldte proceduren. RANDOMIZE Foranlediger at tilfældigtalsgeneratoren startes et vilkårligt sted, når denne kaldes af standardfunktionen RND (X). <var>,<var> READ <svar>,<svar> ... Læser værdier fra data-sætningen og tilknytter disse værdier til de variable nævnt i lister efter READ. REM <comment> Indsætter forklarende tekster i programmet. Påvirker ikke program- udførelsen. REPEAT <comment> <statements> UNTIL <udtr> Udfører <statements> et antal gange indtil <udtr> er sandt. <statement> gennemløbes dog altid mindst n gang. RESTORE <lnr> Tilbagestiller data-pointeren til første data i datalisten eller til en specificeret DATA-sætning.\f STOP <comment> Standser udførelsen af et kørende program. TAB (<udtr>) Bruges i print-sætninger til at tabulere skrivehovedet til den position, der fås ved at udregne <udtr>. WHILE <udtr> THEN DO <statements> ENDWHILE <comment> Udfører <statements> gentagne gange, sålænge <udtr> er sandt. Hvis <udtr> er falsk ved første gennemløb, udføres <statements> ikke. 8.2 RC COMAL standardfunktioner F_o_r_m_a_t_/_b_e_s_k_r_i_v_e_l_s_e_ ABS (<udtr>) Giver den numeriske værdi af <udtr>. ATN (<udtr>) Giver den vinkel, i radianer, hvis tangens er lig med <udtr> (arctangens). COS (<udtr>) Giver cosinus til <udtr>. <udtr> i radianer. EXP (<udtr>) Giver e (2.71828) opløftet til <udtr> "te potens. FN <a> (<d>) Brugerdefineret funktion, som er defineret i DEF-sætningen. INT (<udtr>) Giver den hele del af <udtr>. \f LOG (<udtr>) Giver den naturlige logaritme af <udtr>. RND (<udtr>) Giver et tilfældigt tal mellem 0 og 1. SGN (<udtr>) Giver fortegnet for <udtr>. SIN (<udtr>) Giver sinus til <udtr>. <udtr> i radianer. SQR (<udtr>) Giver kvadratroden af <udtr>. SYS (<udtr>) Giver systeminformationer, baseret på værdien af <udtr>. <udtr> antager følgende værdier: <_u_d_t_r_>_ S_Y_S_(_<_u_d_t_r_>_)_ 0 Sekunder siden midnat 1 Dagen i måneden 2 Måneden i året 3 Året 4 Terminalnummer 5 Tidsforbrug siden "LOG ON" 6 Antal udførte filestatements 7 Fejlkoden for sidst opståede fejl 8 Nummeret på sidst anvendte fil 9 Størrelsen af page 10 Størrelsen af tab 11 Timer siden midnat 12 Minutter siden sidste time 13 Sekunder siden sidste minut 14 Konstanten (3.14159) 15 Konstanten e (2.71828) \f TAN (<udtr>) Giver tangens til <udtr>. <udtr> i radianer. 8.2.1 F_u_n_k_t_i_o_n_e_r_ _t_i_l_ _b_e_h_a_n_d_l_i_n_g_ _a_f_ _t_e_k_s_t_s_t_r_e_n_g_e_ CHR (<udtr>) Giver ASCII tegnet, som svarer til værdien af <udtr>. <svar> LEN(<slit>) Giver længden af tekststrengen. <svar> ORD(<slit>) Giver det decimale tal, som svarer til første tegn i tegnstrengen. 8.3 Matrix operationer i RC COMAL F_o_r_m_a_t_/_B_e_s_k_r_i_v_e_l_s_e_ MAT <mvar 1> = <mvar 2> Kopier elementerne i en matrix til en anden. MAT <mvar 1> = <mvar 2> +_<mvar 3> Matrixaddition og matrixsubtraktion. <mvar 2> MAT <mvar 1> = * <mvar 3> (<udtr>) Multiplicerer en matrix med en anden matrix eller med en skalar. <var> = DET (<udtr>) Giver determinanten af den sidst inverterede matrix. \f MAT <mvar> = CON Etstilling af matrix (1-taller overalt). MAT <mvar> = IDN Enhedsmatrix (1-taller i diagonal, nul i resten). MAT INPUT <mvar 1> ,<mvar 2>, .., <mvar n> Tildeler numeriske værdier indtastet fra brugerens terminal, til en eller flere matricer. MAT <mvar 1> = INV (<mvar 2>) Inverterer en matrix og tildeler resultatet til en anden matrix. ; MAT PRINT <mvar> , <mvar> ... ; Udskriver elementerne i en eller flere matricer. MAT READ <mvar> ,<mvar> ... Læser numeriske data fra DATA-sætningen og tilknytter disse værdier til en eller flere matricer. MAT <mvar 1> = TRN (<mvar 2>) Matrixtransponering. MAT <mvar> = ZER Nulstilling av matrix (nuller overalt). 8.4 Kommandoer til logiske disce F_o_r_m_a_t_/_B_e_s_k_r_i_v_e_l_s_e_ CONNECT <ldname> ,<udtr> Tilkobler brugerens terminal til den logiske disc <ldname>. Hvis beskyttelsesnøglen <udtr> kendes, tillades både læsning og skrivning. Ellers tillades kun læsning. \f COPY "<ldname>:<filename1>","<filename 2>" Kopierer <filename1> fra den logiske disc <ldname> til filen <filename2> på den logiske disc terminalen er tilsluttet. INIT <device> Initialiserer hovedkataloget på <device>. LOCK <device> Forhindrer tilkobling af nye brugere til <device>; f.eks. ved skift af diskette. LOOKUP "LPT" Udskriver en liste over filerne i den tilkoblede logiske disc. RELEASE Frigiver terminalen fra den tilkoblede logiske disc. USERS <device> Angiver antallet af brugere tilkoblet <device>. 8.5 Sætninger til fil-behandling CLOSE FILE(<file>) Lukker en eller flere filer. CREATE <filename>,<size>,<recl> Opretter en fil i den tilknyttede logiske disc. DELETE <filename> Sletter en fil i den tilknyttede logiske disc. EOF (<file>) Funktion som giver + 1, hvis filen <file> er løbet ud over sidste element. I modsat fald fås 0.\f <var> <var> INPUT FILE (<file>) , <svar> , <svar> ... Indlæser data i ASCII format fra en sekventiel datafil i de specificerede variable. MAT INPUT FILE (<file>) , <mvar> ,<mvar> ... Indlæser data i ASCII format fra en sekventiel datafil i de specificerede matricer. MAT PRINT FILE (<file>) , <mvar> ,<mvar> ... Skriver matrice-data i ASCII format i en sekventiel datafil. MAT READ FILE (<file>,<recno>) , <mvar> ,<mvar> ... Læser data i binært format fra en sekventiel datafil eller en record fra en random access fil til de specificerede matrice variable. MAT WRITE FILE (<file>,<recno>) , <mvar> ,<mvar> ... Skriver matrice-data i binært format i en sekventiel datafil eller i en record i en random access fil. OPEN FILE (<file>,<mode>) , <filename> Åbner en datafil, så den senere kan kaldes fra andre file-statements. <udtr> , <udtr>, PRINT FILE (<file>) , <slit> ; <slit> ... ; <svar> <svar> Skriver data i ASCII format i en sekventiel datafil. <udtr><udtr> PRINT FILE (<file>) , USING <format> , <slit> , <slit>..., ;<svar>;<svar>; Skriver data i ASCII format i en sekventiel datafil, hvor der anvendes et specificeret format (<format>).\f <var> <var> READ FILE (<file> ,<recno>) , <svar> , <svar> ... Læser data i binært format fra en sekventiel datafil eller fra en record i en random access til de specificerede variable. RENAME <filename1> , <filename2> Giver en fil på den logiske disc et nyt navn. <udtr> <udtr> WRITE FILE (<file> ,<recno>) , <slit> , <slit> ... <svar><svar> Skriver data i binært format i en sekventiel datafil eller i en record i en random access fil. 8.6 Systemkommandoer i RC COMAL <lnr1> , <lnr2> <lnr1> <lnr1>, ,<lnr2> Sletter en eller flere linienumre. <lnr1> STEP AUTO ,<lnr2> STEP <lnr1> , <lnr 2> Udskriver automatisk linienumre i forbindelse med programmering. BATCH "LPT" Sætter terminalen i BATCH-tilstand, og starter automatisk indlæsning af en jobstrøm fra kortlæseren. Output vil komme henholdsvis på terminalen eller hvis BATCH "<LPT" anvendes, på linieskriveren. BYE Frakobler terminalen fra systemet.\f CON CONL Fortsætter udførelsen af et standset program. Output fra PRINT- sætninger vil komme på terminalen eller hvis CONL anvendes, på linieskriveren. ENTER <filename> Indlæser programmet filename i det eksisterende program. <lnr1> LISTTO , <lnr 2> <filename> < TO <lnr1 , <lnr2> Udskriver det aktuelle program i ASCII format enten på terminalen eller, hvis specificeret, på filen <filename>. LOAD <filename> Indlæser et i forvejen SAVE"d program i binært format fra <filename> ind i brugerens lager. NEW Sletter programmet i brugers lager og lukker alle filer. PAGE = <udtr> Fastsætter terminalens højre margin. <lnr1> TO PUNCH,<lnr2> TO <lnr1> , <lnr2> Udlæser det aktuelle program i ASCII format på terminalens hulle- enhed. \f <lnr1> STEP RENUMBER,<lnr2> STEP <lnr 1> , <lnr2> Giver det aktuelle program nye linienumre. RUN <lnr> RUNL <filename> Udfører det aktuelle program enten fra det laveste linienummer eller fra <lnr>. Hvis <filename> angives, indlæses programmet fra disc og udføres. Hvis RUNL anvendes, vil output fra printsætninger komme på linieskriveren. SAVE <filename> Skriver det aktuelle program, inclusive alle værdier af aktuelle variable og parametre, i binært format i <filename>. SIZE Giver størrelsen i bytes af det aktuelle program. TAB = <udtr> Angiver zonebredden ved udskrift. 8.7 Kommandoer i forbindelse med batch-kørsel EOJ Definerer slutning af et job. SCRATCH <text> Initialiserer et job. TIME = <val> Specificerer den tid et job tillades at køre. Hvis intet specificeres, er TIME = 60 sek. \f LIMITS COMMAND VARIABLES DESCRIPTION COMMENTS MIN. MAX. faa customer no. 0 999994 Starts new invoice invoice type 0 9 debitor no. 0 999994 fb address line 1 0 35 chars. Enters delivery address. Only necessary if address line 2 0 35 chars. delivery address address line 3 0 35 chars. differs from invoice address line 4 0 35 chars. address. address line 5 0 35 chars. fc address line 1 0 35 chars. Enters invoice address. Only necessary if address line 2 0 35 chars. customer"s invoice address line 3 0 35 chars. address does notexist address line 4 0 35 chars. in customer file or address line 5 0 35 chars. different address is required. fca order reference 0 32 chars. fcb delivery code 1 10 Information on mode of Either delivery code or delivery text 0 35 chars. delivery. delivery text must be entered. fcc terms of payment code 1 5 Information on terms of Terms of payment code terms of payment text 0 35 chars. payment. must be entered.\f LIMITS COMMAND VARIABLES DESCRIPTION COMMENTS MIN. MAX. fcd subsidiary code 0 Codification information. salesman no. 800000 899999 sales type 1 8 trade 0 99 media 0 99 district 0 999 fce our reference 26 chars. fch date Closes entries to invoice Date is typed: ddmmyy head. fc? Displays invoice head. fd quantity -2 2 Enters article article no. 6 8 digits information. unit price 0 2 article name 32 chars. free of charge omitted f fe account no. 7 digits Visible percentwise The percent variable is percent -2 2 discount/surcharge. written in units of account text 0 32 chars. 0.01%, i.e. 10% should be typed in as 1000. ff account no. 7 digits Invisible percentwise The percent variable is percent -2 2 discount/surcharge. written in units of 0.01%, i.e. 10% should be typed in as 1000. \f LIMITS COMMAND VARIABLES DESCRIPTION COMMENTS MIN. MAX. fg account no. 7 digits Visible sum sum -2 2 discount/surcharge. account text 0 32 chars. fh account no. 7 digits Invisible sum sum -2 2 discount/surcharge. fia zero set code omitted 0 Subtotal on invoice. If the zero set code is omitted then the sub- total will not be set to zero. fib zero set code omitted 0 Subtotal on display only. If the zero set code is omitted then the sub- total will not be set to zero. fja Fixed subtotal on invoice. fjb Fixed subtotal on display only. fk text no Text in description text 0 32 chars. section of invoice. fp accountno 1 7 digits double discount percent 1 -10000 +10000 surcharge accountno 2 7 digits percent 2 -10000 +10000 accounttext 32 chars. \f LIMITS COMMAND VARIABLES DESCRIPTION COMMENTS MIN. MAX. fq vatcode no. 1 5 V A T f? from line no. Visual check of invoice to line no. 1 500 body visible lines "from line no." "to line no." fl Cancels the result of the last entered command. fn no of labels 0 999 Closes the invoice. text 46 chars. fo Invoice test print. fx Cancels the present invoice. v? article no. 8 digits Display this article on the terminal display. k? customer no. 0 999994 Display this customer on the terminal display. d? debitor no. 0 999994 Display this debtor on the terminal display. s? field no. 1 109 Display this field from company file on the terminal display. \f Program Name: INVOICING Process Name: ..................... 1.0 Introduction The following describes the procedure from the loading of the program (see Section 6.2) to the point where the program can be operated. The actual operation of the program INVOICING is described in the sections 4.1 and 4.2 of this appendix. P_r_o_g_r_a_m_ _I_n_i_t_i_a_l_i_z_a_t_i_o_n_ N_o_t_e_:_ The following procedure can only be performed from the "process owner terminal", i.e. that terminal where the "process name" in Section 5.2.1 is entered. 1) When the command to load the program has been given as described in Section 6.2.1 the following will appear on the terminal display: # invoicing (program loaded in Section 6.2.1) RC 6000 Invoicing System Version 25.08.76 Invoicing date <system date> <country code> <country name> 2) It will take approximately 3 minutes for the program to initialize, whereafter the following will appear on the terminal display: Initializing end (Attention tone sounds to indicate ESC and process name to operator that the system is waiting.) N_o_t_e_:_ From now on the procedure can be carried out from any terminal. 3) Type: ESC The text att # will appear on the terminal display. 4) Type: <process name> RETURN (Process name is given at the beginning of this appendix.) RCSL No. 42-i 0825 Page 1 of37\f The following will appear on the terminal display: RC 6000 Invoicing Routine <system date> <time> # 5) Type: id <identification text> RETURN The following will now appear on the terminal display: # 6) Type: da <flxname> where <flxname> is the name used under the flxdope program. 7) Proceed to Section 1.1 Invoice Head. R_e_m_o_v_i_n_g_ _t_h_e_ _I_N_V_O_I_C_I_N_G_ _P_r_o_g_r_a_m_ 1) When the # appears on the terminal display, Type: luk <identification text> RETURN N_o_t_e_:_ The following can only be performed from the "process owner terminal", i.e. that terminal where the "process name" in Section 5.2 was originally entered. 2) When the # appears on the terminal display, Type: end If other terminals are open when the "process owner terminal" operator writes "end", then the following will appear on the terminal display: terminal <identification text> still running and a worning tone sounds. This terminal must be closed using the procedure in (1) before the end command is effective. 3) If the end command is accepted the following appears on the terminal display: RCSL No. 42-i 0825 Page 2 of37\f invoicing system terminated end <number> # Hereafter a new program can be loaded as described in Section 5.2.1. If a fatal failure (e.g. power failure) occurs during operation of the invoicing program: 1. Insert a flexible disc. 2. Save the file named invlog on the flexible disc. 3. Close down the system. 4. Make a DISC COPY of the drum from yesterday on the drum used today. 5. Make a DISC COPY at the disc with the debtors from yesterday on the disc used today. 6. Flxload the invlog from the flexible disc to the drum. 7. Restart the invoicing program so: # invoicing invlog again. yes. 1.1 Invoice Head Examine the order form: If THE CUSTOMER NO. IS GIVEN, AND IT IS AN INVOICE (invoice type 0 or 1) type: faa <customer no.> "<invoice type>" RETURN The customer must exist in the customerfile. The customer"s name and address are shown on the display. If the invoice is a normal invoice, invoice type 0, the variable <invoice type> can be omitted. If THE CUSTOMER NO. IS GIVEN, AND IT IS A CREDIT NOTE (invoice type, 2, 3, 8 or 9) type: faa: <invoice type> <customer no.> RETURN In this case the customer no. must correspond to a debtor in the debtor file. If THE CUSTOMER NO. IS NOT GIVEN type: faa :<invoice type> RETURN RCSL No. 42-i 0825 Page 3 of37\f If INVOICE TYPE IS 0 simply type: faa RETURN (normal situation). If the CUSTOMER NO. is not given, then when the # character appears on the display the invoice address must be entered as follows: Type: fc <address line 1> RETURN fc <address line 2> RETURN fc <address line 3> RETURN and so on, up to a maximum of 5 address lines. Remember that all text imputs must be preceded and followed by the " character. The sixth successive use of the fc command will return to address line 1, the seventh to address line 2, and so on, so that corrections may be made. If fc followed by RETURN is typed the corresponding line will be unchanged. If a blank line is required, where previously text has been written, then type fc " " RETURN. 1.1.1 If the DELIVERY ADDRESS DIFFERS FROM THE INVOICE ADDRESS then the delivery address must be entered as follows: Type: fb <delivery address line 1> RETURN fb <delivery address line 2> RETURN fb <delivery address line 3> RETURN and so on up to a maximum of 5 address lines. Remember that all text inputs must be preceded and followed by the " character. The sixth successive use of the fb command will return to address line 1, the seventh to address line 2, and so on, so that corrections may be made. If a blank line is required, where previously text has been written, then type fb " " RETURN. 1.1.2 If CUSTOMER ORDER REFERENCE IS GIVEN Type: fca "<order reference>" RETURN RCSL No. 42-i 0825 Page4 of37\f If an error is discovered in the entered information then retype the command with the correct information. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.1.3 If DELIVERY CODE IS GIVEN Type: fcb "<delivery code>" RETURN or: fcb : "<delivery text>" RETURN Remember that all text inputs must be preceded and followed by the " character. If an error is discovered in the entered information then retype the command with the correct information. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. The delivery code is a numerical code (01-10) covering a selec- tion of standard texts. If none of these standard texts can be applied to the present invoice then a delivery text of maximum 35 characters can be used instead. 1.1.4 If TERMS OF PAYMENT ARE GIVEN Type: fcc <terms of payment code> "<terms of payment text>" Remember that all text inputs must be preceded and followed by the " character. If an error is discovered in the entered information then retype the command with the correct information. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. RCSL No. 42-i 0825 Page 5 of37\f The terms of payment code is a numeric code covering a selection of standard texts. If none of these4 standard texts can be applied to the present invoice then a terms of payment text of maximum 35 characters can be used instead. 1.1.5 CODIFICATION MUST BE GIVEN Type: fcd "<subsidiary code>"<salesman no.><sale type><trade><media> <district> RETURN If an error is discovered in the entered information then retype the command with the correct information. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.1.6 If OUR REFERENCE is given Type: fce <our reference> RETURN If an error is discovered in the entered information then retype the command with the correct information. <our reference> is a text of maximum 26 characters. 1.1.7 TO DISPLAY THE INVOICE HEAD Type: fc? RETURN The complete invoice head will now be shown on the terminal display. If mistakes are observed in the displayed invoice head then they can be corrected simply by typing in the appropriate command with the correct variables. N_o_t_e_:_ BE CAREFUL whencorrecting. Make sure that optional variables in a command are not forgotten when corrections are made. 1.1.8 CLOSING ENTRIES TO THE INVOICE HEAD MUST BE MADE Type: fch "<date>" RETURN If an error message appears on the terminal display then, if necess- ary, see Section 1.4 Error Messages, under the appropriate errorno. RCSL No. 42-i 0825 Page 6 of37\f This command closes entries to the invoice head and hereafter, if corrections are necessary, the command fx must be used. The fx command will cancel the present invoice. The variable date must be entered if a different invoice date than that given automatically by the RC 6000 System is required. 1.2 Invoice Body Examine the order form: 1.2.1 Enter the ARTICLE LINES Type: fd <quantity> <article no.> "<unit price>" "<article text>" "<free of charge>" RETURN Normally, it will only be necessary to enter quantity and article no. as the other variables (unit price, article text, free of charge) are optional. If these variables are to be used, it will be indicated on the order form. If "free of charge" is required then simply type an "f" character for this variable. Remember that all text inputs must be preceded and followed by a " character. If the sales type from the codification is <= 4 then unit price 1 from the article file is used, if not unit price 2 is used. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.2 A_s_c_e_r_t_a_i_n_ _t_y_p_e_ _o_f_ _d_i_s_c_o_u_n_t_/_s_u_r_c_h_a_r_g_e_ _r_e_q_u_i_r_e_d_ There are 4 types of discount/surcharge line: 1. Visible line - percentwise adjustment 2. Invisible line -percentwise adjustment 3. Visible line - sum adjustment 4. Invisible line - sum adjustment A visible line is a discout/surcharge line which will appear on the invoice. RCSL No. 42-i 0825 Page7 of37\f An invisible line is a discount/surcharge line which does not itself appear on the invoice, but modifies the last entered article line. Instructions as to which type of discount/surcharge line should be applied can be found on the order form. If no instructions are given then use the visible percentwise adjustment. 1.2.2.1 If A VISIBLE PERCENTWISE ADJUSTMENT IS REQUIRED Type: fe <account no.> <percent> "<account text>" RETURN The variables account no. and percent will be found on the order form. Remember that all text inputs must be preceded and followed by a " character. The fe command may be used at any point on the invoice body. If this command is used after an article line then a percentage discount/surcharge will be given on the price of that article. If, however, this command is used after a subtotlal line then a percentage discount/surcharge is given on all the articles included in the subtotal. If an error is discovered in the entered information then use the fl command to cancel the line and then retype the fe command. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.2.2 If AN INVISIBLE PERCENTWISE ADJUSTMENT IS REQUIRED Type: ff <account no.> <percent> RETURN The variables account no. and percent will be found on the order form. If an error is discovered in the entered information then use the fl or fx command to cancel the line and then retype the ff command. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. RCSL No. 42-i 0825 Page 8 of37\f 1.2.2.3 If A VISIBLE SUM ADJUSTMENT IS REQUIRED Type: fg <account no.> <sum> "<account text>" RETURN The variables account no. and sum will be found on the order form. The fg command may be used at any point on the invoice body. If an error is discovered in the entered information then use the fl or fx command to cancel the last line or the complete invoice. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.2.4 If AN INVISIBLE SUM ADJUSTMENT IS REQUIRED Type: fh <account no.> <sum> RETURN The variables account no. and sum will be found on the order form. The fh command may be used at any point on the invoice body, but may only be used in special circumstances. If an error is discovered in the entered information then use the fl or fx command to cancel the last line or the complete invoice. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.2.5 If A DOUBLE VISIBLE PERCENTWISE ADJUSTMENT IS REQUIRED Type: fp <accountno. 1><percent 1><accountno. 2><percent 2>"<text>" RETURN The variables account nos and percents will be found on the order form. The fp-command may be used at any point on the invoice body. If this command is used after an article line then the percentage discounts/surcharges will be given on the price of that article. If, however, this command is used after a subtotal line then the percentages/discounts are given on all the articles included in the subtotal. RCSL No. 42-i 0825 Page 9 of37\f At the invoice sheet there would be one percentwise adjustment calculated as the sum of percent 1 and percent 2. The text used is the text tied up with accountno 1 unless the text variable is used. Internal in the system it react as if you have typed the command fe twice with account no. 1 percent 1 and account no. 2 percent 2, respectively. 1.2.2.6 if V. A. T. IS REQUIRED Type: fq "vatcode" This command produce a fixed subtotal at the invoice followed by a percentage adjustment with percentage and accountno selected from company file depending on "vatcode". If vatcode is one or omitted the percentage in companyfile field 35 and accountno in field 36 are selected. If vatcode is 2 the contend of field 37 and 38 are used a.s.o. N_o_t_e_: If an error is discovered in the entered information then use the fl command twice, first time to cancel the percentage adjustment and second time to cancel the fixed subtotal. 1.2.3 If A SUBTOTAL LINE IS REQUIRED ON THE INVOICE Type: fia "<zero set code>" RETURN The subtotal will then appear on the terminal display and on the completed invoice. If the zero set code = 0 then the subtotal will be set to zero after display. If the zero set code is omitted then the subtotal will not be set to zero after display, i.e. type fia RETURN. If an error is discovered, by the operator, in the entered information then use the fl command to cancel the line and retype the fia command. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. RCSL No. 42-i 0825 Page 10 of37\f 1.2.4 If A SUBTOTAL IS REQUIRED ON THE DISPLAY ONLY Type: fib <zero set code> RETURN The subtotal will then appear on the terminal display only. If the zero set code = 0 then the subtotal will be set to zero after display. If the zero set code is omitted the subtotal will not be set to zero. N_o_t_e_._: Zero-setting at this point will, in practice, only be made if a subtotal must be accumulated from this point. If an error is discovered in the entered information then use the fl command to cancel the last line and retype the fib command. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.5 If A FIXED SUBTOTAL IS REQUIRED ON THE INVOICE Type: fja RETURN The fixed subtotal will then appear on the terminal display and on the completed invoice. Fixed subtotal is set to zero at the start of a new invoice. This fixed subtotal command can be used, for example, to accumulate the total on the invoice before VAT. This amount is then used as the basis of the VAT calculation. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.6 If A FIXED SUBTOTAL IS REQUIRED ON THE DISPLAY ONLY Type: fjb RETURN The fixed subtotal will then appear on the terminal display only. This facility is intended only for checking purposes. RCSL No. 42-i 0825 Page 11 of37\f If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.7 If A TEXT IS REQUIRED IN THE DESCRIPTION SECTION OF THE INVOICE Type: fk "<textno>" "<text>" RETURN If the variable <textno> is used then the text with that number and texttype 5 is fetched from the textfile. If only the variable <text> is used then the entered text is used. If neither <textno> or <text> are used, then there would be a blank line on the invoice. The text can contain up to a maximum of 32 characters per line. Remember that all text inputs must be preceded and followed by a " character. If an error is discovered in the entered information then use the fl command to cancel the last line and retype the fk command. If an error message appears on the terminal display then, if necessary, see Section 1.4 Error Messages, under the appropriate error no. 1.2.8 If A VISUAL CHECK OF THE INVOICE BODY WITH VISIBLE LINES ONLY IS REQUIRED Type: f? <from line no.> <to line no.> RETURN The corresponding visible lines from the invoice body will now appear on the terminal display. As a general rule 20 lines can be simultaneously displayed on the terminal display. Use this command with the variables set at 1 20, 21 40, 41 60 etc., until the required area on the invoice is found. 1.2.9 If A VISUAL CHECK OF THE INVOICE, WITH BOTH VISIBLE AND INVISIBLE LINES, IS REQUIRED Type: f?? <from line no.> <to line no.> RETURN The corresponding visible and invisible lines from the invoice will now appear on the terminal display. As a general rule 20 lines can RCSL No. 42-i 0825 Page 12 of37\f be simultaneously displayed on the terminal display. Use this command with the variables set at 1 20, 21 40, 41 60 etc., until the required area on the invoice is found. 1.2.10 If CORRECTIONS TO LINES ENTERED TO THE INVOICE BODY ARE NECESSARY Type: fl RETURN The result of the last entered command will be cancelled be it an article line, a discount/surcharge line, a subtotal line or a text line. Successive use of the fl command will cancel lines from the bottom of the invoice body. Before cancelling lines in the invoice body, make sure that the effect of cancelling the lines can be seen on the terminal display. Use the f?? command, if necessary. 1.2.11 If CANCELLING OF THE COMPLETE INVOICE IS NECESSARY Type: fx RETURN 1.2.12 If AN INVOICE TEST-PRINT IS REQUIRED Type: fo RETURN The printer will then write out an invoice layout pattern so that a text alignment check on the invoice can be made. 1.2.13 CLOSE THE INVOICE Type: fn "<no of labels>" "<text>" RETURN The variable <no of labels> is optional and need only be typed in if delivery address labels are required for delivery. <text> can contain up to 46 characters. The invoice is now complete and will be written out on the printer. RCSL No. 42-i 0825 Page 13 of37\f N_o_t_e_: If the text change diskette appears on terminal display after fn command then the flexible disc is full. The program will now stop. The following procedure should then be followed: 1) Remove the flexible disc. 2) Insert new flexible disc which has already been named with flxdopeprogram (see Section 5) and has color green. 3) Repress WRITE PROTECT pushbutton. Light must be out. 4) Type: da <flxname> RETURN This tells the postings program what the flexible disc is called.<flxname> should appear on the flexible disc cover. 5)When the # character appears proceed with invoicing program, i.e. type fn again. N_o_t_e_: The command db can be used at any time to remove a flexibledisc before it is full, if necessary, I.e., Type: db RETURN The flexible disc can now be removed. 1.3 Summary of Invoicing Commands The following pages are a summary of all the commands associated with invoicing. The variables belonging to the various commands are written in the correct order with information on the upper and lower limits which these variables can take in practice. The description section states the function of the command and the comments section informs of any special requirements which may be valid for a particular command or its variables. RCSL No. 42-i 0825 Page 14 of37\f 1.4 Error Messages - Invoicing Error messages will have the following general appearance: error <error message no.> <error message text line 1> "<error message text line 2>" "<error message text line 3>" "<figure 1>" "<figure 2>" "<figure 3>" The following is a numerical list of error messages with further information together with suggestions for remedial action. E_r_r_o_r_ _M_e_s_a_g_e_ _N_o_._ _1_._ Text: Payment code does not exist in companyfile. Information:The number of paymentcodes created in company file, and the paymentcode just put in or fetched from customerfile. Cause: The number just entered with the fcc command or the paymentcode fetchedfrom the customer identidified with the customer number in faa- command does not correspond to any payment condition in company file. Remedial action: Put in an existing payment condition code or a payment condition text with the commandfcc. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_ Text: Sale account does not exist in account file. Information: Sales account from companyfile. Cause: Lack of correspondence between Sale account in Company File and the sale account existing in the account file. Remedial action: Cancel the current invoice and wait until the files are corrected by means of File Maintenance program before invoicing again. RCSL No. 42-i 0825 Page 19 of37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_ Text: Command context incorrect. Information: None. Cause: A command used where it may not be used, e.g. a command to the invoice head after the invoice head has been closed with the fce command. Remedial action: Use an allowed command or cancel the current invoice. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _4_ Text: Article unknown. Information: None. Cause: Article with entered article no. does not exist in article file because: a) article no. entered incorrectly b) article no. incorrectly written on order form c) article no. not yet entered in article file. Remedial action: a) Invoice after correction. b) Return order form to order administration. c) Enter article no. into article file. RCSL No. 42-i 0825 Page 20 of37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _5_ Text: Article name does not exist in textfile. Information: None. Cause: The article exists in the article file, but the article description does not exist in the text file. Remedial action: Enter article name together with the command and make a note of the fact that the article name must be entered the next time file maintenance is carried out. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _6_ Text: Insufficient space for article name or account text on this invoice sheet. Information: The number of lines left on the actual invoice sheet. Cause: This error message can only occur if an article or account text required more than one line on the invoice, and this article or account occurs at the bottom of an invoice sheet. Remedial action: 1) Retype the command and use the optional text parameter to type in an abbreviated article name or account text. 2) Start a new invoice sheet. RCSL No. 42-i 0825 Page21 of37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _7_ Text: No more room on this invoice. Information: None. Cause: All the available memory space allocated to an invoice is occupied. This memory space con- tains the "invisible lines" (i.e. those which do not appear on the invoice) as well as the "visible lines" (i.e. those which are printed out on the invoice). It is, therefore, not possible to give the maximum no. of sheets one invoice may contain, as this will depend on the complexity of the invoice. Remedial action: This error message occurs prematurely, so that there is always sufficient room for a subtotal line, a surcharge/discount line, and a V.A.T. line. The necessary lines should be entered and the invoice closed. The rest of the order should be written on a new invoice to the same customer. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _8_ Text: Account no. unknown. Information: None. Cause: The account no. used in the surcharge/discount line does not exist in the account file. a) Is the account no. entered correctly? b) Is the correct account no. used? c) Has the account number been entered to the account file? Remedial action: a) Enter the command once again with the correct account no. b) and c) Cancel the current invoice and keep the order form until the account file is brought up-to-date or the account no. is corrected. RCSL No. 42-i 0825 Page 22 of 37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _9_ Text: Both customerno and debitorno have been typed in, or debitorno and invoice type less 2 have been given. Information: None. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_0_ Text: Salesman/salestype incorrect. Information: None. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_1_ Text: Account for invoice total or account for rounding of coins does not exist in the account file. Invoice is now cancelled. Information: Account - from company file. Cause: Lack of agreement between codes in company file and account file. Remedial action: The current invoice is cancelled automatically. Terminate the run in the normal way. Do not attempt to invoice before the files are corrected by means of the file maintenance program. RCSL No. 42-i 0825 Page 23 of 37 \f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_2_ Text: Incorrect remainder 7 check. Information: None. Cause: The entered customer no cannot exist because the remainder 7 check is incorrect. Remedial action: Enter the command once more with the correct number, or return the order form to order administration for correction of thecustomer no. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_3_ Text: Delivery code and delivery text have both been omitted. Information: None. Cause: Either delivery code or delivery text must be typed in. Neither of these have been entered. Remedial action: Type one of the commands and the corresponding parameter or omit them. If the command is omitted the corresponding area on the invoice will remain blank. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_4_ Text: Terms of payment code out of range. Information: None. Cause: Terms of payment code greater than the limit in company file. Remedial action: Use an existing code. RCSL No. 42-i 0825 Page 24 of 37 \f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_5_ Text: Salesman/trade incorrect. Information: None. Cause: Salesman/trade combination does not exist in codification file. Remedial action: If the codes are correctly entered (i.e. the same as those on the order form), return the order form to order administration. Either the order form is incorrectly filled out or the codification file is incorrect. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_6_ Text: Salesman/media incorrect. Information: None. Cause: Salesman/media combination does not exist in codification file. Remedial action: If the codes entered are the same as those on the order form then return the order form to order administration.Either the order form is incorrectly filled out or the codification file is incorrect. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_7_ Text: Salesman/district incorrect. Information: None. Cause: Salesman/district combination does not exist in codification file. Remedial action: If the codes are correctly entered (i.e. the same as those on the order form), return the order form to order administration. Either the order form is incorrectly filled out or the codification file is incorrect. RCSL No. 42-i 0825 Page 25 of 37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_8_ Text: Trade/sale Type/media incorrect. Information: None. Cause: If trade code is 0 or media code is 0 or both are 0, then sale type cannot take the values 1, 2, 5 or 6. Remedial action:Chech codification on order form. If this is typed in correctly then return order form to order administration. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _1_9_ Text: Salesman does not exist in statistics file. Information: None. Cause: The salesman exists in the codification file, but not in the statistics file. Remedial action: Cancel the invoice and correct the files. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_0_ Text: Named commands to invoice head required. Information: <command> <command> Cause: After the closing entry to the invoice head, the commands written out are found to be missing. Remedial action: Type the required commands with the corresponding parameters. RCSL No. 42-i 0825 Page 26 of 37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_1_ Text: Information from sales statistics file has disappeared. Information: <salesman no.> Cause: Program or hardware error. Failure to comply with installation requirements. Remedial action: Check sales statistics file. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_2_ Text: Incorrect invoice type. Information: None. Cause: Only 0 Normal invoice 1 Internal invoice 2 Internal credit note 3 Internal credit note 8 External credit note 9 External credit note are allowed. Remedial action: Retype the command with the correct invoice type, if possible; if not, cancel the invoice. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_3_ Text: Date must be in same calendar year as system"s date. Information: <system date> Cause: The date typed in is not in the same year as the system"s date, i.e. the date entered when the system is started. Remedial action: Enter the correct date or interrupt invoicing routine and start system up with the appropriate date. RCSL No. 42-i 0825 Page 27 of 37 \f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_4_ Text: Post-dated invoice. Information: <system date> Cause: The entered date must not be post-dated relative to the system date. Remedial action: Retype the command with the correct date. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_5_ Text: Incorrect date. Information: None. Cause: The entered date does not comply with the rules for dates (e.g. 310476 or 401399 are incorrect). The correct format is: <dat> <month> <year> e.g. 130776. Remedial action: Retype command with the correct date. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_6_ Text: Article does not exist in article file. Information: None. Cause: Error message occurs with command v? "display article". Remedial action:1) Check that article no. is typed correctly in. Or: 2) Note that this article must be opened when File Maintenance program is used. RCSL No. 42-i 0825 Page 28 of 37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_7_ Text: Customer does not exist in customer file. Information: None. Remedial action: 1) Check that customer no. is typed correctly in. Or: 2) Note that this customer no. must be opened when File Maintenance program is used. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_8_ Text: Printer error. Information: None. Cause: 1) Paper empty 2) Paper creased 3) Printer not selected 4) Printer not switched on. . Remedial action: 1) Put more paper in printer 2) Replace creased paper 3) Select printer 4) Switch printer on. If an invoice remain in the system, it will be output together with the next output. See also instructions for your printer in Section 8 Operation of Peripheral Equipment. RCSL No. 42-i 0825 Page 29 of 37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_9_ Text: Printer testprint error. Information: None. Cause: 1) Paper empty 2) Paper creased 3) Printer not selected 4) Printer not switched on. Remedial action: 1) Put paper in printer 2) Replace creased paper 3) Select printer 4) Switch printer on. See also instructions for your printer in Section 8 Operation of Peripheral Equipment. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_0_ Text: Standard text does not exist in textfile. Information: None Cause: Text with entered textno. does not exist in textfile, because a) text no. entered incorrectly b) text no. incorrectly written on order form c) text no. not yet entered in the text file. Remedial action: a) put in textno correct b) return order form to order administration c) enter the text manualy to the invoice and enter the text in textfile by means of the maintenance program when invoicing is finished. RCSL No. 42-i 0825 Page 30 of 37\f E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_1_ Text: Hard error on terminal. Information: None. Cause: Power supply to terminal cut off, Connection faulty or cut off, Hardware error. The error message appears on the main terminal. If the program is performing an invoicing routine the invoice currently under preparation at the terminal will be cancelled. Remedial action: Try to start the terminal with the attention key (ESC <process name>). E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_2_ Text: Unknown command. Information: None Cause: An unacceptable command has been typed, in error. Remedial action: Avoid the use of this command. Use an acceptable command. RCSL No. 42-i 0825 Page 31 of 37\f T_ E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_3_ Text: Account no 1 does not exist in account file. Information: None. Cause: Account with the first entered account no. does not exist in account file, because: a) account no. entered incorrectly b) account no. incorrectly written on order form c) account no. not yet entered in account file. Remedial action: a) enter account no. correct b) return order form to order administration c) enter account no. into account file by means of the maintenance program. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_4_ Text: Text in numeric field. Information: None. Cause: An attempt to put text in a numeric field of company file. Remedial action: Type the correct field no. or correct information. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_5_ Text: Entered value is out of range. Information: None. Cause: A value which lies outside of the specified min-max limits for the chosen field. Remedial action: Type the correct field no., or type an appropriate value in the field. RCSL No. 42-i 0825 Page 32 of 37\f T_ E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_6_ Text: Numeric value in text field. Information: None. Cause: An attempt to put in a numeric value in a text field of company file. Remedial action: Type the correct field no., - correct information or use the right command. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_7_ Text: Terminal identification does not exist. Information: None. Cause: Occurs when the "luk" command is used. The identification text used has not been used before, or the terminal in question is already closed. Remedial action: E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_8_ Text: Debtor is not inserted in debtorfile. Information: Code for reason. Cause: Depending on code 2: A debtor with the same debtor no. (invoice no.) already in file. 3: Too expensive in running time (will only happen in very extreme situations). 4: File is full. 5: Length error (program or hardware error). 6: No buffer (will only occur if an extreme large number of debtors are created in one run of the program. Remedial action: The invoice is printed out and written on the floppy. Various files are updated, but the debtor is not inserted in the debtorfile. RCSL No. 42-i 0825 Page 33 of 37\f T_ E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_9_ Text: Account desappeared from account file. Information: <Account no.> Cause: Program or hardware error. Remedial action: The line will be automatically set to zero, but the opposite entry in the account file does not occur. Check total account file. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _4_0_ Text: Account no. 2 does not exist in account file. Information: None. Cause: Analogous to error 33. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _4_1_ Text: Terminal identification text reserved. Information: None. Cause: Another terminal is using the same identification text. Remedial action: Choose another identification text. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _4_2_ Text: No more lines to cancel. Information: None. Cause: No lines in invoice body. RCSL No. 42-i 0825 Page 34 of 37\f T_ E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _4_5_ Text: Customer disappeared during the invoicing process. Information: Number of the disappeared customer. Cause: Program or hardware error. Error Messages No. 43, 44, 46, 47 and 48. See Postings program. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _4_9_ Text: Pct. or sum equal zero. Information: None. Cause: An attempt to give a discount at 0. Possible a space between the minus sign and the figures. E_x_a_m_p_l_e_:_ fe 7777770 - 1000 would give this error. The correct way typing this command is fe 7777770 -1000 Remedial action: Retype the command in the correct way. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _5_0_ Text: Delivery code does not exist in the company file. Information: The number of delivery codes opened in the company file. Cause: Analogous to error message no. 1. RCSL No. 42-i 0825 Page 35 of 37\f T_ E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_0_7_ Text: VAT-percent not created in company file. Information: None. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_5_1_ Text: Debtor disappeared during the invoicing process. Information: The number of the disappeared debtor. Cause: Possibly program or hardware error or access to the same debtor from to terminals. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_5_2_ Text: No room for additional invoice references on the customer. Information: None. Cause: The customer has got more than 28 not paid invoices. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_5_3_ Text: No room for additional invoice references on the customer. Information: None. Cause: As error message 252, but invoicing from to terminals to the same customer. RCSL No. 42-i 0825 Page 36 of 37\f T_ E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _2_5_4_ Text: No sale to this customer. Information: None. Cause: There is a mark for no further sale on the customer record. E_r_r_o_r_ _M_e_s_s_a_g_e_ _N_o_._ _3_0_3_ Text: Debtor does not exist in debtorfile. RCSL No. 42-i 0825 Page 37 of 37 \f Program Name: CREATEFILE Process Name: ..................... 1.0 Introduction The following describes the procedure from the loading of the program (see Section 6.2) to the point where the program can be operated. The actual operation of the program CREATE FILE is described in sections 1.1 of this appendix. P_r_o_g_r_a_m_ _I_n_i_t_i_a_l_i_z_a_t_i_o_n_ N_o_t_e_: The following procedure can only be performed from the "process owner terminal", i.e. that terminal where the "process name" in Section 5.2.1 was originally entered. 1) When the command to load the program has been given as describedin Section 6.2.1 the following will appear on the terminal display. #createfile input std. file number and file size or special file name. input 0 if stop # 2) Proceed to Section 1.1 of this appendix. R_e_m_o_v_i_n_g_ _t_h_e_ _C_R_E_A_T_E_ _F_I_L_E_ _P_r_o_g_r_a_m_ 1) Type: 0 The following will appear on the terminal display: end <number> # Hereafter a new program can be loaded as described in Section 5.2.1. RCSL No. 42-i 0828 Page 1 of4\f 1.1 Procedure 1) Calculate the required file size in segments as follows: File 1 - Article File Number of articles x 20/512+20% File 2 - Customer File Number of customers x 200/512+20% File 3 - Account File Number of accounts x 40/512+20% File 4 - Codification Check File Number of keys x 4/512+20% File 5 - Text File Number of texts x 232/512+20% File 8 - Statistics File Number of salesmen x 52/512+20% When these calculations have been made add 2-3 segments to each to allow room for file headings. 2) Type each file no. and file size (no. of segments) as instructed by the RC 6000 system (see 7.0 Introduction step (1)). If we use the previous example of an account file (file no. 3) requiring 8 segments, then Type: 3 8 RETURN Or, more generally, Type: <file no.><file size> RETURN The following will now appear on the terminal display: start create file : <file name> 4) Wait approximately 3 minutes until the following appears on the terminal display: RCSL No. 42-i 0828 Page 2 of4\f end create input std. file number and file size or special file name . input 0 if stop # 5) If <file size> = 0 is typed for a particular file no. then the file will be given a standard file size. If this method is used then the files will be expanded auto- matically when required during use of the MAINTAIN program, i.e. the following text will appear on the terminal display: start reorg. filename : <filename> Wait approximately 3 minutes until the following appears on the terminal display: end reorg. # Now continue with MAINTAIN program. If you want to put in new records in a file, it is necessary that the file contains some free space. When the file is filled up, it is reorganized, that means, that the records are spread over a greater area, so that there are about 25% free space between them. To save room at the disc, it is possible to compress the files after updating so that the records are placed close one after another. That is done with the program compress, - see below. If you wantto reorganize the file, you can use the program reorgfile. The calls of reorgfile and compress is done so: reorgfile #RETURN compress type std filenumber type 0 to stop #5 RETURN RCSL No. 42-i 0828 Page 3 of4\f reorgfile start :textreg. compress reorgfile end compress type std number type 0 to stop # 0 RETURN END XX # RCSL No. 42-i 0828 Page 4 of4\f Editing Commands A complete line can be written on the terminal display without the RC 6000 acting on the command. The RC 6000 will first react when the RETURN key is depressed. It is therefore possible to correct typing errors before the RETURN key is depressed. The line editing commands are the RUB OUT and LIND FEED keys. Pressing RUB OUT will delete the last typed character, whereas pressing LINE FEED will delete the complete line. When RUB OUT is depressed the & character will appear on the terminal display, and when LINE FEED is depressed the % character will appear on the terminal display. E_x_a_m_p_l_e_ _1_ Type: abcd RUB OUT efgh RUB OUT RUB OUT RUB OUT i RETURN The RC 6000 will read the line as follows: abcei E_x_a_m_p_l_e_ _2_ Type: abcd LINE FEED RETURN The RC 6000 will read a blank line. E_x_a_m_p_l_e_ _3_ Type: abcd LINE FEED efg RETURN The RC 6000 will read the line as follows: efg N_o_t_e_:_ A common error message is ! syntax This indicates that an error has been made during the typing in of a command or its variables. It could for example be a spelling error. The exclamation mark (!) appears almost directly under the character in error. When a syntax error appears the command has not been accepted, therefore retype the command correctly. RCSL No. 42-i 0422 Page 1 of 1\f \f «eof»