|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 19200 (0x4b00) Types: TextFile Names: »fpreadinp«
└─⟦621cfb9a2⟧ Bits:30002817 RC8000 Dump tape fra HCØ. Detaljer om "HC8000" projekt. └─⟦0364f57e3⟧ └─⟦185aba3e6⟧ »libman« └─⟦this⟧ └─⟦00964e8f7⟧ Bits:30007478 RC8000 Dump tape fra HCØ. └─⟦b2ec5d50f⟧ └─⟦845422199⟧ »libman« └─⟦this⟧
fpreadman=set 63 disc3 global fpreadman fpreadman=compose *pl 297,18,250,4,3**pn 0,0* *lw 175**ps 0**sj* H. C. Ørsted Institute Computer Department Universitetsparken 5 DK-2100 København Ø *nl4* *ct* HCØ RC8000 algol8 library read fp procedure system "fpreadman" *nl8* Anders Lindgård *sj* *nl19**lm 120* 78/4 *lm120**nl* September 1978 Revised 1980.10.10 *nl* *rj**pn 5,0**ps 18* *lm0* Copyright 1976 Anders Lindgård.*nl* For the time being this procedure set can be used freely for research or other nonprofit purposes. Any other use demands written permission from the author. *ns 1,4,Read fp procedure system* ------------------------*nl**np* The file processor language "fp" (ref. 1) for handling programs and passing parameters to programs are nice and convenient to use. But to read them in an algol program is a little tricky using the standard system. In algol 6 (ref. 2) it is possible by the entry system(4,i,arr); to scan the items in the fp-command-list for the call of the running algol program. Using system(4,i,arr); it is possible to read the items in the parameterlist in any order, but the information which system(4, gives back is not really in a nice and easely usable form. It further requires a detailed knowledge of the exact formats of the file processor. In ref. 3 a sequential scanning procedure readparam is described. The formats of readparam is easier to remember but sequential scanning is not allways what a programmer want. *np* The procedures described here is an attempt to give the programmer an easy to use tool for searching the parameterlist in a random manner. There is a close resemblance with the procedures described here and the conversational input procedures of ref. 4. *np* A sample program for using the procedures described here and some of the procedures described in ref. 5 is included to show how to use the system. *ns 1,2,The procedures and variables.**nl* *np* The system consist of a set of procedures and some standard variables. The first call of any of the procedures will initialize the system including most of the standard variables. If the standard variable fplist is set to true by the program before the first call the fp-command-list will be listed on current output. The fp-command-list is treated according to the syntax described below, which is a restricted version of the fp syntax. Items in the fp-command-list which do no fulfill the syntax cannot be read by the procedures, but no errormessage is given. Parameters are scanned from left to right and only the first occurrence of a boolean, integer or real parameter is significant. *ps0* *ns 1,3,Syntax of command list.* *sj* <ls> <programname> <parameterlist> <ls>::= <text>=/<empty> ; left side in call, intended as output <programname>::=<text> ; name of program document <parameterlist>::=<boolean parameter>/<integer parameter>/ <real parameter>/<text parameter>/ <input parameter>/<extended parameter>/ <parameterlist><parameterlist> <boolean parameter>::=<SP><text>.<boolean> <integer parameter>::=<SP><text>.<integer> <real parameter>::=<SP><text>.<integer>/ <SP><text>.<integer>.<integer2> <text parameter>::=<SP><text>.<text> <input parameter>::=<SP><text><SP> ; intended as input <extended parameter>::=<boolean parameter><extension>/ <integer parameter><extension>/ <text parameter><extension> <extension>::=.<integer>/.<text>/<extension>.<extension> <boolean>::=yes/ja/true/sand/ no/nej/false/falsk <integer2>::=<integer>/0.<integer>/<integer2> <text> and <integer> must fullfill the fp syntax. *lm10**nl2* *rj* *mt 1,NB.* The strange definition of <integer2> in <real parameter> is due to fp's interpretation of 2.03 as 2.3. To obtain the result 2.05 it is nessecary to write 2.0.5 *ps0**sj* *ct* System variables Alphabetic list of predeclared variables*nl* *ta 30,30,30* integer fpbooleans boolean fpin integer fpints integer fpinareas integer fpitems boolean fplist integer fpnr boolean fpout integer fpreals boolean fptestpr boolean fpunstacki *rj* *nl2**lm0* The boolean fptestpr is only for debugging the system.*nl2* Before the first call of any procedure only fplist and fpunstacki are of interest.*nl* fplist, if true the command list is listed on current output.*nl* fpunstacki, if true and an <input parameter> is found next to <programname> current input is unstacked. ▶01◀Algol running system has stacked it. Remember to stack current input before program exit, if unstacking has taken place. *nl2* After the first call of any procedure the variables are initialized as follows:*nl* *lm30* *mt 1,fpin* true if <input parameter> is found next to <programname> else false *nl* *mt 1,fpout* true if a left side <ls> was found else false *nl* *mt 1,fpitems* sum of <boolean parameter> and <integer parameter> and <real parameter> and <text parameter> and <input parameter>. <ls>,<extension> and <programname> is not counted. *nl* *mt 1,fpinareas* number of <input parameter> found *nl* *mt 1,fpbooleans* number of <boolean parameter> found *nl* *mt 1,fpints* number of <integer parameter> found *nl* *mt 1,fpreals* number of <real parameter> found *nl* *mt 1,fptexts* number of <text parameter> found *lm0* *nl2* <extended parameter> is counted under the first parameter. *nl* fpnr points to the current parameter and is intended for use by the sequential procedures "readifpnext" and "readsfpnext". *ps0* *ct* Alphabetic list of procedures *ta 30,30,30,30* boolean procedure connectinp boolean procedure connect_ls_o boolean procedure initfp boolean procedure readbfp boolean procedure readifp boolean procedure readifpnext boolean procedure readinfp boolean procedure readlsfp boolean procedure readrfp boolean procedure readsfp boolean procedure readsfpnext boolean procedure takefpitem *ps0* *ct* References *sj* \f ref. 1. H. Rischel and T.A. Aris System 3 Utility Programs Part one RCSL 31-D364 Regnecentralen Copenhagen 1975 ref. 2. H. Dinsen Hansen (Ed.) Algol 6, Users Manual RCSL 31-D322 Regnecentralen Copenhagen 1974 ref. 3. P. Bruun Madsen GA4000 RC4000 Department H.C.Ørstedinstituttet Copenhagen 1971 ref. 4. A. Lindgård Read procedure system 78/05 Computer Department H.C.Ørstedinstituttet Copenhagen 1976 ref. 5. A.Lindgård Code procedure system 78/06 Computer Department H.C.Ørstedinstituttet Copenhagen 1976 *cm insert example here* *ps0* *lm0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure connectinp *nl2* *rj**np* Connects the current input zone "in" to the filedescriptor specified by the inp_number of the <input parameter>. <input parameter> must be the name of a filedescriptor and it must be possible to connect in to the filedescriptor else an alarm is given and the procedure becomes false. When connection has taken place setposition is used to position the document according to file count and block count in the filedescriptor. *nl2* Call: connectinp(inp_number)*nl* *lm55* *mt 1, connectinp**cm 6 spaces*(return value, boolean). true if the <input parameter> described by inp_number is connected, false otherwise.*nl* *mt 1, inp_number*(call value, integer). The inp_number of the <input parameter>, see the introduction. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure connect_ls_o *nl2* *rj**np* Connects the current output zone "out" to the filedescriptor specified as a left side parameter to the program call. If no left side is specified the procedure becomes false. If the filedescriptor does not exist a discarea of 150 segments is created. In case of an error in the connection procedure an alarm is given, and the procedure becomes false. When connection has taken place setposition is used to position the document according to file count and block count in the filedescriptor. *nl2* Call: connectlso*nl* *lm55* *mt 1, connectlso**cm 6 spaces*(return value, boolean). true if the program was called with a left side and connection could take place, false otherwise. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure initfp *nl2* *rj**np* This procedure initializes the read fp procedure system. If fplist is true the command list is listed on current output. However any call of any of the procedures in this system will initialize the system. *nl2* Call: initfp*nl* *lm55* *mt 1, initfp**cm 6 spaces*(return value, boolean). true if the program was called with more parameters than <program name>, false otherwise. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure readbfp *nl2* *rj**np* Searches the command list for a <boolean parameter>, where <text> matches the string in the call. If found the boolean variable in the call is set according to the value in the command list and the procedure becomes true, else the boolean variable in the call will obtain the specified initialvalue.*nl* Only the leftmost matching parameter is used. *nl2* Call: readbfp(text,bool_var,initial_val)*nl* *lm55* *mt 1, readbfp**cm 6 spaces*(return value, boolean). true if a matching <boolean parameter> was found, else false. *nl* *mt 1, text*(call value, string). The string which is matched with <SP><text> in the program call. *nl* *mt 1, boolvar*(return value, boolean). If a matching <boolean parameter> was found it becomes true if the <boolean> was yes/ja/true/sand else false. If no matching <boolean parameter> was found the parameter initial_val is assigned to bool_var. *nl* *mt 1, initialval*(call value, boolean). If no matching <boolean parameter> was found this value is assigned to bool_var. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure readifp *nl2* *rj**np* Searches the command list for an <integer parameter>, where <text> matches the string in the call. If found the integer variable in the call is set according to the value in the command list and the procedure becomes true, else the integer variable in the call will obtain the specified initialvalue.*nl* Only the leftmost matching parameter is used. *nl2* Call: readifp(text,int_var,initial_val)*nl* *lm55* *mt 1, readifp**cm 6 spaces*(return value, boolean). true if a matching <integer parameter> was found, else false. *nl* *mt 1, text*(call value, string). The string which is matched with <SP><text> in the program call. *nl* *mt 1, intvar*(return value, integer). If a matching <integer parameter> was found it obtains the value of <integer>. If no matching <integer parameter> was found the parameter initial_val is assigned to int_var. *nl* *mt 1, initialval*(call value, integer). If no matching <integer parameter> was found this value is assigned to int_var. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *lm0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure readifpnext *nl2* *rj**np* Reads an <extension> of type <integer> to a parameter, as pointed to by specified number. *nl2* Call: readifpnext(number,int_val,initial_val)*nl* *lm55* *mt 1, readifpnext**cm 6 spaces*(return value, boolean). true if .<integer> was found at the position given by number+1. See ref 1. *nl* *mt 1, number*(call value, integer). The number of the fp parameter.*nl* *mt 1, intval*(return value, integer). If the parameter was .<integer> intval will be assigned the integer else it will be asssigned inittialval. *nl* *mt 1, initialval*(call value, integer). See above. *nl2**np* *lm0* The recommended way of using this procedure is to get hold of an .<integer> after a call of readbfp, readifp or readsfp. This is done using the standard variable fpnr. *nl2* Example:*nl2* *lm10* readifp(<:integer:>,i1,5);*nl* readifpnext(number,i2,5);*nl* *nl2* *lm0* After a call of the program as follows:*nl**lm10* program integer.6.9*nl**lm0* the two variables i1 and i2 will be 6 and 9 respectively *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure readinfp *nl2* *rj**np* The <input parameter> specified is delivered as a textstring in an array. *nl2* Call: readinfp(input,number)*nl* *lm55* *mt 1, readinfp**cm 6 spaces*(return value, boolean). true if the program was called with at least number <input parameter>'s, false otherwise.*nl* *mt 1, input*(return value, real array). Must be declared at least from 1:2. Contain the text packed in element 1 and 2. *nl* *mt 1, number*(call value, integer). The number of the <input parameter> as counted from left towards right. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure readlsfp *nl2* *rj**np* Examines the program call for a left side. If found the name is delivered by the procedure. *nl2* Call: readlsfp(output)*nl* *lm55* *mt 1, readlsfp**cm 6 spaces*(return value, boolean). true if the program was called with a left side parameter, false otherwise. *nl* *mt 1, output*(return value, real array). Must be declared at least 1:2. Will contain the left side name in element 1 and 2. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* real procedure readrfp *nl2* *rj**np* Searches the command list for a <real parameter>, where <text> matches the string in the call. If found the real variable in the call is set according to the value in the command list and the procedure becomes true, else the real variable in the call will obtain the specified initialvalue.*nl* Only the leftmost matching parameter is used. *nl2* Call: readrfp(text,real_var,initial_val)*nl* *lm55* *mt 1, readrfp**cm 6 spaces*(return value, boolean). true if a matching <real parameter> was found, else false. *nl* *mt 1, text*(call value, string). The string which is matched with <SP><text> in the program call. *nl* *mt 1, realvar*(return value, real). If a matching <real parameter> was found it obtains the value of <real>. If no matching <real parameter> was found the parameter initial_val is assigned to real_var. *nl* *mt 1, initialval*(call value, real). If no matching <real parameter> was found this value is assigned to real_var. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure readsfp *nl2* *rj**np* Searches the command list for an <text parameter>, where <text> matches the string in the call. If found the text variable in the call is set according to the value in the command list and the procedure becomes true, else the text variable in the call will obtain the specified initialvalue.*nl* Only the leftmost matching parameter is used. *nl2* Call: readsfp(text,text_var,initial_val)*nl* *lm55* *mt 1, readsfp**cm 6 spaces*(return value, boolean). true if a matching <text parameter> was found, else false. *nl* *mt 1, text*(call value, string). The string which is matched with <SP><text> in the program call. *nl* *mt 1, textvar*(return value, real array). Must be declared at least 1:2. If a matching <text parameter> was found it obtains the value of <text>. If no matching <text parameter> was found the the string initialval is moved to textvar. *nl* *mt 1, initialval*(call value, string). If no matching <text parameter> was found this value is moved to text_var. *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *lm0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure readsfpnext *nl2* *rj**np* Reads an <extension> of type <text> to a parameter, as pointed to by specified number. *nl2* Call: readsfpnext(number,text_val,initial_val)*nl* *lm55* *mt 1, readsfpnext**cm 6 spaces*(return value, boolean). true if .<text> was found at the position given by number+1. See ref 1. *nl* *mt 1, number*(call value, integer). The number of the fp parameter.*nl* *mt 1, textval*(return value, string). If the parameter was .<text> textval will be assigned the text else it will be asssigned inittialval. *nl* *mt 1, initialval*(call value, string). See above. *nl2**np* *lm0* The recommended way of using this procedure is to get hold of an .<text> after a call of readbfp, readifp or readsfp. This is done using the standard variable fpnr. *nl2* Example:*nl2* *lm10* readifp(<:text:>,A1,<: unknown:>);*nl* readifpnext(number,A2,<: unknown:>);*nl* *nl2* *lm0* After a call of the program as follows:*nl**lm10* program text.first.last*nl**lm0* the array A1 will contain the string "first" and A2 the string "last". *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ps0* *qr* 1978-09-17 Anders Lindgård *nl2* *ct* boolean procedure takefpitem *nl2* *rj**np* This is the central procedure in the system, which performs matching of parameters and syntax checks. It is not intended for normal use so no detailed description will be given. *nl2* Call: takefpitem(text,type,int,A)*nl* *lm55* *mt 1, takefpitem**cm 6 spaces*(return value, boolean). true if an item with specified type, and a <text> matching text is found, false otherwise. *nl* *mt 1, type*(call value, integer). The type of the item. *nl* *mt 1, int*(return value, integer). Used by the number handling procedures for obtaining .<integer>. *nl* *mt 1, A*(return value, real array). Used by the texthandling procedures for obtaining .<text>. *lm0* *nl2**np* *np* *lm0**nl4* *ns 1,2,Language* --------*nl* ALGOL *ns 1,2,Maintenance level* -----------------*nl* user *ef* ▶EOF◀