FILE CALLS SUMMARY ================== High Common ----------- FCSERR (see explanation under low common) High Routines ------------- call OPEN. (fil$,acc$,channel%,recordsize%) fil$ is full or partial spec e.g. "SY0:[123,321]WITTENOOM.ASS;12345" or "FRED" acc$ = "R" for read only "W" for write (=create new version of file) "M" for modify (=update but no extend) "U" forupdate (=normal access mode) channel% = user assigned number in range 20:30 inclusive (channel 20% uses LUN 20, 21% uses LUN 21, etc.) recordsize% = record size in bytes call OPENA. (Filename$,Channel%) Append mode to a text file - create file if it doesn't exist call OPENU. (Filename$,Channel%,Record.Size%) Update mode to a record file - create file if it doesn't exist call CLOSE. (channel%) channel% as for OPEN. call GET. (channel%,buffer$,lnmt%) channel% as for OPEN. buffer$ is destination of read & must be recordsize%(of OPEN.) bytes long lmnt% is element (record) number to read lowest lnmt% is 1% call PUT. (channel%,buffer$,lnmt%) channel% as for OPEN. buffer$ is destination of write & must be recordsize%(of OPEN.) bytes long lmnt% is element (record) number to write lowest lnmt% is 1% call GET.N (channel%,buffer$) as for GET. but reads NEXT element call PUT.N (channel%,buffer$) as for PUT. but writes NEXT element call GETS. (channel%,buffer$,lmnt%,number%) as for GETs but gets number% elements starting at #lmnt% call PUTS. (channel%,buffer$,lmnt%,number%) as for PUTs but puts number% elements starting at #lmnt% call PUT.A (channel%,buffer$) as for PUT. but writes just after last current record: PUT.Append call FCSNOB (channel%,numberofbytes) returns the number of bytes in the file open on channel% call FCSNOR (channel%,numberofrecords) returns the number of records in the file open on channel% Low Common ---------- FCSERR ERR1% error code from FCS (0%=OK) ERR2% error code from FCS: directive status code FCSCA1 INI% =-1 after FCSINI called (root it) FCSCA2 FDB$(10%)=96% FDBs for channels #20%:#30% (luns 20.:30.) (root it) FCSCA3 FDBADR%(11%) [0%]=junk (root it) [i%]=address of FDB$(i%-1%) FCSCA4 A.$ OPEN$ Mode Bytes (root it) FCSCA5 A(1%),A$=1% local scratch for FCSDIE (does not need to live in root) FCSCA6 WHERE$=4% where we got last input record using INOUT. (root it) FCSCA7 FCSWHO% which channel% INOUT. last used (root it) Low Routines ------------ FCSINI macro - read it FCSOPN by ref (fdbadr%,lun%,acc%,fil${,recz%}) macro - read it FCSCLS by ref (fdbadr%) macro - read it FCSGET by ref (fdbadr%{,buf${,lolmnt%{,hilmnt%}}}})macro - read it FCSPUT by ref (fdbadr%{,buf${,lolmnt%{,hilmnt%}}}})macro - read it FCSTEL by ref (fdbadr%,where$) macro - read it FCSSEK by ref (fdbadr%,where$) macro - read it C. (C%) checks C% is legal channel # L. (L%) checks L% is legal record number N. (N%) checks N% is >0% FCSFDB not executable: initialises FDBADR% of F.C.S. Sequential Files ---------------- To open a sequential (typable) file just use recordsize%=0%. Sequential files have variable record sizes (each record may have a different size). So you must always say how long a record is on output & find out how long a record is on input. Output ------ call BZSET. (channel%,buffersize%) to say how long an output record is. Then call PUT.N (channel%,buffer$) to output the first buffersize% bytes of buffer$. Then check FDBERR to see if it worked. Input ----- call BZSET. (channel%,buffersize%) to set the maximum input line length allowed. Then call GET.N (channel%,buffer$) which will input the next record (line) to buffer$. If the line is longer than buffersize% then an error is noted in FDBERR and only the first buffersize% characters of the line appear in buffer$. Then call BZENQ. (channel%,buffersize1%,buffersize2%). This will return buffersize1% & buffersize2%. buffersize2% will be the number of characters input to buffer$, and this is normally the record length. Naturally, the first buffersize2% characters of buffer$ are used and the rest of buffer$ is unchanged. Names ----- BZSET. stands for Buffer siZe SET. BZENQ. stands for Buffer siZe ENQuire. High-Level Routines ------------------- call INPUT. (channel%,buffer$,size%) Inputs a record to buffer$. returns size% = actual record length got rest of buffer$ is unchanged call INOUT. (channel%,buffer$,size%) as for INPUT. but remembers where we got record from for OPRIN. to use call PRINT. (channel%,buffer$) outputs a record from buffer$ call OPRIN. (buffer$) as for PRINT. but overprints last record read by INOUT. uses same channel% as last INOUT. call call PRINL. (channel%,buffer$,size%) outputs a record that is the first size% bytes of buffer$ Task-Building ------------- Specify new subroutines (or new main) ------------------------------------- just type: MCR>#BUILD this will build your .ODL & .CMD files Build new .TSK file ------------------- MCR>@progname where progname is the main-program-name that you told #BUILD [end: FCSCALLS.DOC]