File: FOCHLP.HL of Disk: V50/Source/Source-Listing-PAL-2
(Source file text)
DATA PROCESSING FOCAL 2020 While writing a program, you may ask 'HELP' to review sections, phrases, words or symbols listed below by giving the direct command 'L G HELP'. Should you wish to return to your program before help's response is done, hold down The 'ctrl' key while striking the 'o' then type 'g' and hit 'return'. Index for 'help' DPF FOCAL--2020 Commands symbols functions --------------- ------------- ----------------- Elem. Commands arith. Symbols FABS( ) absolute value -------------- -------------- FATN( ) arc-tangent FCOS( ) cosine Ask ^ exponentiation FEXP( ) exponential Comment * multiplication FITR( ) integer Continue / division FLOG( ) log (base e) Do + addition FRAN( ) random number Erase - substraction FSGN( ) sign part For () parentheses FSIN( ) sine Go [] square brackets FSQT( ) square root Goto <> angle brackets FIN ( ) charac. Input If FOUT( ) charac. Output Modify special characters FIND( ) charac. Search Branch ------------------ Quit Return & form feed miscellaneous Set ' line feed ------------- Type ! Return/lf Write # reset page changes from other FOCALs : tab/cr only device names % output format direct commands Library commands $ symbol table error codes ---------------- " text expressions ? Trace files Library Call e power-of-ten indirect commands Library Delete rubout/delete command decoder Library Gosub ^c exit km. Cd options Library Load ^g bell/modify ccl commands Library Run ^h back space line numbers Library Exit ^i hor. 8-tab precision Library Save ^k modify names of files ^l form feed pip/fotp/direct ^n cr only (files) pushdown list ^o break char. Virtual arrays ^p break char. Size of programs File commands ^z end-of-file strings ------------- ^u kill line subscripting _ kill line summary of comma Line feed key tabulator Open Input return key variables Open Output * format fill secret variables Open Input " ($)alt mode/escape function overlay Open Output " space key interrupt handling Output Close , comma(delimiter) Open Array ; semicolon (") Output Terminate ***** miscellaneous Words and phrases listed under miscellaneous in the index but not given in the 'bulk' print out are found under their own names. 'Files', for example, is described under 'file Commands'. ***** changes from FOCAL, 1969 Programs written in FOCAL, 1969 should require only one Change to run under OS/8 FOCAL, 1971: The input device is switched to the high speed paper tape reader with the 'open input ptr:' command and switched back to the terminal with 'open input ptr: ,echo' instead of with the '*' command of FOCAL,1969. ***** programs written in OS/8 FOCAL,1971 require following Changes to run under DPF FOCAL--2020 A) t # is not the cr-only command any more. B) library list has been deleted. C) syntax of o r o, o r i changed to o o ", o i " Extra features compared to OS/8 FOCAL are: 1) Extra library features: device-independent chaining to other OS/8 programs, virtual numeric arrays, subscripted library names. 2) 10 digit precision, and/or standard trig. Functions may be deleted by cd options or recalled by special functions. 3) Modify can also modify line numbers. Modify without argument uses last line number 4) Tabulation is now forwards and backwards (also normal ^i tab) 5) 'if' understands logical expressions 'For' is also decrementing 6) new branch command (if-do) 7) character manipulations handled with 'fin()' , 'Fout()' and 'find()' 8) internal full tty: handler (pile-up, form feeds, etc) 9) extra formatting possibilities with t % command 10) Several special variables are proected from the 'Erase' command --- one is PI, $ is the tty: input buffer, VE is version number, others are interrupt flags 11) DPF FOCAL's starting address is 200 (field 0) Ctrl/p and ctrl/o are internal break characters ----------------------------------------------- Ctrl/c is keyboard monitor break character ------------------------------------------ Note: DPF FOCAL data files are compatible with OS/8 edit and Os/8 teco; however, DPF FOCAL program files and arrays are saved as core images. ***** commands: Most commands must be followed by a space *** direct commands are typed without line numbers and DPF FOCAL executes them as soon as the return or the alt mode/escape button is hit---for example: #Type 3+4 (causes FOCAL to type a 7) (or several commands may be given in Sequence:) #Set X=3 #Set Y=2 #Type 3+X+Y,! 8.0000 #Type X+Y-4$ 1.0000 # *** indirect commands are used for longer programs. They are typed following line numbers and may be executed by a direct 'go': #2.1 Set X=3 #2.2 Set Y=2 #2.3 Type 3+X+Y,! #Go 8.0000 #Go$ 8.0000 # *** the DPF FOCAL commands: Examples of each are given followed by the general form in Which: <required terms> are enclosed in angle brackets. [optional terms] are enclosed in square brackets. (comments) are enclosed in parentheses. A, b, c, x, y, and z are variables. L1, l2 and l3 are line numbers. G1 stands for a group or line number in most cases, group and line numbers may be replaced by variables. *** Elementary commands: Ask y (expects a value to be input for y) A z (A is the abbreviation for 'Ask' --- all Commands have single letter abbreviations) A B2,X,Number A "how many?", M (types 'how many' then sets m = to the Response) Ask A,B,C, (allows three variables to be given values) (space, comma or carriage return will ter- minate each number input; type a '_' or ^u To erase a partially typed number --- it may then be retyped.) #Set A=PI alt/escape leaves the variable with its #Ask A$$ 3.1416 former value and echoes it # (3 command decoder options provide automatic printing of a ':', '?' or bell, by the 'ask' command) ** Ask ["print out in quotes"] X [,Y,Z] ---------------------------------------------------------- Comment sqrt (comments are used to tell about program) Continue (dummy line) C print routine ** C (lines beginning with a 'c' will be ignored) ---------------------------------------------------------- Do 7.24 (tells FOCAL to execute line 7.24 then return D 4.48 to the command following the 'Do') Do 7$ (executes group 7, and stays on the same line) D g1;D 7.6 (executes line (or group) g1 then line 7.6) ** Do [line or group number] ---------------------------------------------------------- Erase 2.17 (deletes line 2.17 from indirect program) E 3 (deletes any group 3 lines --- 3.01 through 3.99) Erase (zeroes all variables) Erase all (erases entire indirect program) ** Erase [line or group number] (zeroes variables if no Number given) ---------------------------------------------------------- For P=1,7;Type 3 (outputs a '3' seven times) For J=1,5;Do 17.1$ (does line 17.1, five times) F X=2,-2,-8;t X/5,! (outputs .4 0 -.4 -.8 -1.2 -1.6 For Z=1,Y;Do 7 (does group 7, Y times) ** For X=e1[,e2],e3;[command to be repeated] ('for' commands repeat and add 1 (or 'E2') to 'e1' each time; then go to next line when 'e1' exceeds 'e3' if e2 positive or when e1 is less than e3 when e2 negative ---------------------------------------------------------- Go 8.17 (starts executing program at line 8.17) Goto 3.1 (starts executing program at line 3.1) Go (starts executing program at lowest line) G$ (same but stays on the same line) Go ? ('trace feature' -- prints program during execution) G x (starts executing program at line x) ** go [line number] (starts executing indirect program at Line l1) ---------------------------------------------------------- I (H-5)1.3,1.5,1.7 ('if' checks the value inside the parentheses) If (Y)2.7,1.2,l1 (FOCAL goes to line 2.7,1.2 or l1 if Y is -, 0, or +) I (B-3)2.8,7.9; (goes to next command if (B-3) is positive) I (Z)2.7;T 21 (if Z is less than 0 --- then 2.7; otherwise 'type 21') I (G)2.1,l1,2.4 if Q=0 then goes to line l1) ** if (E1)l1[,l2,l3] (next executes line l1, l2, or l3 de- pending on whether e1 is -, 0, or +) ---------------------------------------------------------- ** logical if's #I (A,<,B)1.8;T "<"$< (when a .lt. B this types < , # otherwise goes to line 1.8) I (X,=,0)1.5;T "0" (types '0' when X=0) I (X,>=,Y)6.9,l2 (goes to l2 when X .ge. Y,to 6.9 otherwise) ** if (e1,rel,e2)l1[,l2] execute l2 (or end of line) When condition is met. (rel:relational operator: <,>,=,<=,>=,<> <>:.not.) ---------------------------------------------------------- 'Modify 3.72' followed by a 'return' or alt/escape will cause 03.72 to be typed, typing the letter 'x' will cause The line to be typed through its first 'x'. You may then: 1) type in rest of revised line and hit 'return' 2) use 'rub out' to erase single characters or the line number (in the latter case retype new line number) 3) hit 'line feed' to keep remainder of old line 4) hit ctrl/k to go to next occurrence of 'x' 5) hit ctrl/bell to change search character; then hit new character 6) hit '_' or ^u to delete line over to left margin *Modify l1 (let l1=1.23) 01.23 c ('c' is the particular search character chosen) ---------------------------------------------------------- Q (abbreviation) *Quit (terminates program execution) (and sometimes returns to the KM) ---------------------------------------------------------- R (abbreviation) *Return (allows escape from a 'do loop' to the command following the 'do' or 'library gosub') ---------------------------------------------------------- Set Y=37$ (causes 'Y' to take the value 37) S A=110/P+32(causes 'a' to assume the value of 110/p+32) S Y=Y+1 (sets the new value of Y = 1 plus old value) S Z=$;t Z (permits typing value of tty: input buffer) S #=0 (only way to zero protected variable '#') *set Y=<number,variable or expression> ---------------------------------------------------------- Type 3 (outputs a 3 on the teleprinter or other output device) T 3$ 3.000 (example of the use of alt/escape) # T X/Y-1 (outputs the value of the expression x/y-1) T "a"!"b"!"c"! (outputs 'a', 'b' and 'c' in a vertical row) T ! (outputs a return/line feed) T &,' (types a formfeed followed by a linefeed) T # (resets the line/page counter to zero) T (#) (outputs value of interrupt flag '#') T "ans: ",26+5 (outputs 'ans: 31') T :8,"/",:8,"\" (outputs 'X' in position 8 on tty-line) T $ (outputs the symbol table) T %10.09 (sets the output format to allow up to 10 digits to be printed, of which 9 may be decimal places) T % (formats output in powers-of-ten notation) T %+3 (floating output with 3 significant places) T %\X ('\' deletes leading space) T %$3.02,9 (types $ 9.00 ) T %*7.02,-33(types **-33.00 ) (a cd option provides automatic printing of an '=' or ':' by The'Type' command) *Type [numbers, variables, expressions, text in quotes &,', !,#,:,$ or %] ---------------------------------------------------------- Write 2.27 (outputs line 2.27 of the indirect program) W 2 (outputs group 2) Write all (outputs entire indirect program) W (same) W x (outtputs group or line given by 'x') *Write [group or line number] (lists program) ---------------------------------------------------------- *** library commands: Library <command>[device:]<program name> [line number] *** OS/8 device names: Sys: system device (rka0: in rk05 system; or dta0: in dectape system) Dsk: rkb0 in rk05 systems; dectape #1 in dectape systems ('dsk:' is assumed if a device is not specified) Dta0: - dta7: dectape drives (tc08 controller) Tda0: - tda7: dectape drives (td8e controller) Mta0: - mta7: magtape drives Cdr: card reader Ptr: high speed reader Ptp: high speed punch Lpt: line printer Bat: batch stream input Tty: terminal (may be used with other devices through 'echo') edou: Edit output to pseudo lineprinter edin: Edit input from pseudo lineprinter Library call chisqr (gets program 'chisqr.fc' for use) L c tda2:prgram (gets 'prgram.fc' from td8 dectape #2) L c test1 (gets 'test1.fc' from dsk:) L c bigp(x) (gets bigp11 if x=11) *Library call [device:]<program name> ---------------------------------------------------------- Library del ttest (deletes 'ttest.fc' from dsk:) L d tda2:prog (deletes 'prog.fc' from td8e tape #2) L d hold.fd (deletes data file 'hold.fd') L d array.fa (deletes array.fa from dsk:, has to be used to create new array of same name) * * * this command closes open output files * * * ---------------------------------------------------------- *Library delete [device:]<program name> (assumes .fo name extension) ---------------------------------------------------------- Library gosub text <13.7> (line 13.7 of 'text' becomes a subroutine which returns to the command following 'gosub') (when a 'gosub' is executed by a new program, the new program will be saved as 'FOCAL.tm') L g sumsqr (treats entire 'sumsqr' program as subroutine) L g calc(X) <Y> (treats group 7 of 'calc4.fo' like a 'do' Subroutine , when X=4 and Y=7) * * * this command closes open output files if given by an unsaved version of a program * * * ---------------------------------------------------------- Library load prog.sv (OS/8 chain to prog.sv on sys:) L l fcuser (chains to some special version of DPF , we lose all variables!) L l chan(X) (chains to chan99.sv if x=99 , 99 Is maximum number for indexes) L l fcarit (overlays the arithmetic functions On DPF initially without functions) *Library load [sys:]<file name> (forces .sv extension) ---------------------------------------------------------- Library run john (loads 'john.fo' then starts program) L r dta2:zonk (runs 'zonk.fo' from tc08 tape #2) L r pop <22.81> (starts 'pop.fo' at line 22.81) * * * programs containing 'runs' must be saved before execution * * * ---------------------------------------------------------- *Library run [device:]<program name> [line number] (transfers execution to named program) ---------------------------------------------------------- Library save prog (saves indirect program as 'prog.fo') L s tda6:zaap (saves 'zaap.fo' on td8e tape #6) L s prgnam (saves 'prgnam.fo' on dsk:) - - - line 0 of program is changed to: C-prgnam.fo mar-75 (if the program was saved in march-75) *** old 'prgnam.fo' is deleted when new 'prgnam.fo' is saved * * * this command closes open output files * * * *Library save [device:]<program name> ---------------------------------------------------------- L e (abbreviation) *Library exit (leaves FOCAL; returns to OS/8 monitor) ---------------------------------------------------------- *****^c ^c has same function but also works in Os/8 handlers - it is the preferred exit *** these exits close all files and wait for end of tty: *** the experienced programmer may read and write OS/8 compatible data Files with many devices. DPF assumes .fo and .fd as name extensions for program and data files respectively. Data files are saved in standard OS/8 ascii format and are edit and teco compatible. DPF uses the .fa extension for virtual array files, the Numbers are stored in these files in 4-word floating point. The terminal (tty:) is DPF's normal input and output device. The 'open input' command permits selecting another device for input 'Open output' does the same for output. Be sure to close one output File before opening another. ',echo' added to the input commands echoes the input data on the output device. When added to output commands, it causes the output to be echoed on the terminal. 'Output close' empties the output buffer onto the device and saves the file if the device is file structured (disk or magnetic tape). The 'open input tty:,echo' command will restore the terminal as the input device with echo. After an error occurs or 'ctrl/o,p' is struck, the terminal is restored as both input and output device. At the same time all output files are closed to prevent a loss of information. Reading and writing can be resumed with previously opened non-tty: Devices through 'open input "' and 'open output "' commands. Note: when writing FOCAL data files, it is necessary to include a space, comma, carriage return or other delimiter preceding any minus signs, otherwise the number will appear positive when 'asked'. A delimiter will be automatically 'typed' if not specifically deleted with ' type %\x ' . Open input bleep (switches input to 'bleep.fd' file on dsk:) O i dta4:red (opens 'red.fd' file on dectape drive #4) O i table,echo (will echo on output device while reading 'table.fd' from the dsk:) Open input tty:,echo (restores terminal to normal function) O i tty:,e (abbreviation) * * * ctrl/z is the end-of-data-file character. Attempts to read past it Will output an ?EF error and switch input to the terminal. * * * *Open input [device:][file name][,echo] (prepares to read a file) ---------------------------------------------------------- Open output dk (opens 'dk.fd' to be written on the dsk:) O o dta7: zz[17] (opens 'zz.fd' file to be written on dectape) (length.le.17 blocks) O o dope,echo (echoes on tty: while writing 'dope.fd' on dsk:) (be sure to give an 'output close' when done) * * * open output files will be closed if the commands 'library save' or 'library delete' are given or if 'library gosub' is given by a version of a program that has not been saved. * * * * * * failure to insert a delimiter between negative numbers 'typed' to a file will result in their being read as positive. Features '4,5' or 'yes' of the initial dialogue provide Automatic spacing. * * * *Open output [device:][file name][,echo] (prepares to write a file) ---------------------------------------------------------- Open input " (resumes 'asking' for data from a previously opened input file after using tty: input with an 'open input tty:,echo') O i " (abbreviation) O i ",e (same plus echo) *Open input "[,echo] (resumes input from non-tty:) ---------------------------------------------------------- Open output " (resumes 'typing' on previously opened output device after using tty:) O o " (abbreviation) O o ",echo (same plus echo) *Open restore output[,echo] (resumes output to non-tty:) ---------------------------------------------------------- *Output close (ends file writing and saves output file if device is file structured (disk or magnetic tape).) * * * also all breaks ^o,^p,^c close open files. ---------------------------------------------------------- ***** symbols: *** arithmetic symbols: Exponentiation [^] (indicates an integer exponent) Type 3^2 (outputs a '9' --- 3 to the second power) Set X=Y^Z (sets x equal to y raised to the integral z power) Type 2^3.5 (outputs an '8' --- the .5 is dropped) Multiplication [*] Type 2*4 (outputs an '8') Set X=Y*Z (sets x equal to y times z) Division [/] Type 6/2 (outputs a '3') Set X=Y/Z (sets x equal to y divided by z) Addition [+] Type 2+2 (outputs a '4') Set X=Y+Z (sets x equal to y plus z) Subtraction [-] Type 3-x (outputs the value of 3-x) Set X=Y-Z (sets x equal to y minus z) Enclosures (),[], and <> may be used interchangeably in matched pairs to enclose quantities which are to be operated on as a unit. *** special characters: Return/line feed [!] Type !!!!,X,!! (outputs 4 carriage return/line feeds, the value of x, and then 2 more carriage return/line feeds. Carriage return [:] or ^n See what the ':' does in line 10.35 (see how the '/' and the '\' are superimposed) #10.35 type "X=/",:," \",!!!!! #d 10.35 X=X Tab [:x] See what the ':x' does in line 11.37 11.37 Type "Name---":25,"roger":40,"Age = ",2*13,:7,"jones",!! Name---jones roger Age = 26.0000 Output formatter [%] See what the '%' does in line 12.30 12.30 set x=123.456; Type %$6.04 X,!; Type %*4.02 X,!;T %3.0 X, !;T %+6,X,! $ 123.456 *123.5 124. 1.23456e+02 '%4.02' permits four digits to be output including up to two decimal places; 'type %' alone gives powers of ten notation. 'T %\x' removes the leading space A non operator, terminator, digit will be used as leading char When immediately following the '%'. 'T %*x' will do a left fill with stars. Symbol table [$] Type $ (outputs list of defined variables) Quotation marks ["] Text may be typed by enclosing it in quotes See what the '"' does in line 14.65 14.65 type "the answer is ",3+8,!!!!! The answer is 11.0000 Trace [?] The first time DPF reads a '?' (except within quotes) it will start outputting the program while it is executing it; the next time it encounters a '?' it will stop typing out the program. See what the '?' does to line 15.60 15.60 set X=3;? Set Y=5;type X/Y,!? Set Y=5;type X/Y, 0.6000! A 'go ?' command will trace the entire program. Power of ten [e] See what the 'e' does to line 6.80 06.80 type 1e1, 7e3, 1.23e-2, 3.76e217,!!!!! 10.0000 7000.00 0.0123 0.376000e+218 Rubout key [del] When writing a program, one character will be erased each time The rubout key is struck; rubout will show as a '\' --- thus: 'Plwea\\\ease' becomes 'please'. Ctrl/c (pressing 'ctrl' and 'c' at the same time) Will return user to the OS/8 monitor and close all files -- the 'library exit' command is kept for compatibility With PS/8 FOCAL,1971. Ctrl/p, ctrl/o are the break characters. Ctrl/g [bell] (pressing 'ctrl' and 'g' at the same time) Used with the 'modify' command to change the search character. Ctrl/i [tab] (is the horizontal tab code and can be used in quoted type statements) Ctrl/K (pressing 'ctrl' and 'k' at the same time) Used with 'modify' to skip to the next search character. Ctrl/p (pressing 'ctrl' and 'p' at the same time) Ctrl/o (pressing 'ctrl' and 'o' at the same time) DPF FOCAL's break characters --- ends program execution And causes DPF FOCAL to print its '#', or to return to the KM. Ctrl/z (pressing 'ctrl' and 'z' at the same time) Is the last character in a DPF FOCAL data file. Attempts to read past the end-of-file will cause a '?EF' error to be typed on the terminal and will restore the terminal as the input Device. Line feed (or ctrl/j) Used with the 'modify' command to retain remainder of modified Line. Kill line [_] (back arrow) or ^u When writing a program, '_' or ^u deletes everything over to Left margin. In response to 'ask' , '_' kills the number being entered. Return key Used with the 'modify' command to delete remainder of Modified line. 'Return' is a legal symbol for separating data provided to An 'ask' command. Alt mode key ('escape' or 'prefix' on some terminals) In response to an 'ask' command, alt mode retains the previous value of the variable, and echoes it in the current format. Also used instead of return for terminating line. Space key It is a legal symbol for separating data requested by an 'ask' Comma [,] It is a legal symbol for separating data in type and ask. See what the ',' does to line 26.40: 26.40 type 2,3,5/6, 12^3,!!!! 2.0000 3.0000 0.8333 1728.00 Semicolon [;] Separates commands when placed together on one line See what the ';' does to line 27.42: 27.42 set X=17;type 3*X;set X=3/7; type " ",X+3,!!!! 51.0000 3.4286 ***** Functions: For most functions, a sample line is shown and then executed: FABS( ) absolute value Example (written then executed): 03.40 Type FABS(-3),FABS(2),!!!! 3.0000 2.0000 FATN( ) arctangent argument range: 0<a<10^6 05.25 type FATN(1),!!!!;comment: outputs radian angle whose tangent = 1.00 Precision does not exceed 6 digits and drops for near-zero arguments 0.7854 Another way to get this number is: type pi/4$ 0.7854 ------- Tangent 'FTAN( )' is not available Tangent is computed as the quotient (sine/cosine) 05.55 Type FSIN(1)/FCOS(1),!!!!;comment: outputs tangent of 1 radian 1.5574 (could be implemented in another overlay like FCARIT - - - if somebody feels like it!!!) FCOS( ) cosine 06.27 type FCOS(1),FCOS(3/2),!!!!; comment: outputs cosines of 1 & 1.5 radians 0.5403 0.0707 FEXP( ) exponential 08.24 Type FEXP(1),FEXP(2.17),!!!!; comment: natural base to the power (X) 2.7183 8.7583 FITR( ) integer Serious rounding errors occur for numbers of more than 5 digits. The problem may be handled by adding empirical constants to the Argument. 09.18 type FITR(3/2),FITR(23.719),FITR(-2.99),!!!! 1.0000 23.0000 - 2.0000 FLOG( ) natural logarithm 10.14 type FLOG(1),FLOG(4.237),FLOG(10),!!!! 0.0000 1.4439 2.3026 FRAN( ) random number 11.22 type FRAN( ),FRAN( ),FRAN( ),FRAN( ),FRAN( ),! 0.5255 0.9827 0.2605 0.0001 0.5004 The pseudo-random numbers produced are part of a very long and well Distributed but deterministic series. However,FRAN( ) does not generate truly random numbers. FSGN( ) sign 12.34 t %1.0 FSGN(2.78)," ",FSGN(-299)," ",FSGN(0)," ",FSGN(-1),!!!! 1 -1 0 -1 FSIN( ) sine of an angle given in radians 13.52 type FSIN(1),FSIN(0),FSIN(37-2.22),!!!! 0.8415 0.0000 - 0.2207 FSQT( ) square root of a positive number 14.40 type FSQT(4),FSQT(391),FSQT(.0038953),!!!! 2.0000 19.7737 0.0624 FIN( ) character input function Asks for a character from the terminal (or a file); example: 09.14 set X=FIN( ) Sets X to the descimal ascii code of the input character Another way of looking at the terminal is via the secret Variable $. This variable is the teletype input buffer and thus It can be glanced at during program execution, Without stalling it. FOUT( ) character output function Example: 09.25 set A=FOUT(X) Outputs the character whose code equals X Control characters are normally converted to the ^x form When doing output to the tty:. This feature can be inhibited By issueing an o i tty: (without ,e!!!) If an 'L' were typed in response to line 9.14, x would be set equal to 204. Then line 9.25 would cause an 'L' to be output. The 'A' on line 9.25 is a dummy variable. FIND( ) character search function Looks for ascii character with specified code in an Input stream. Example: 1.1 o i text,e 1.2 s z=find(154) 1.3 o i tty:,e;q This echoes file text.fd from dsk: on the terminal Up to ^z. (end of file: decimal code 154) Decimal ascii codes: For FIN( ) and FOUT( ): Code character cd. Char. Cd. Char. ---- ----------- --- ----- --- ----- 128 ctrl/shft/p 160 space 192 @ 129 ctrl/a 161 ! 193 A 130 ctrl/b 162 " 194 B 131 ctrl/c 163 # 195 C 132 ctrl/d 164 $ 196 D 133 ctrl/e 165 % 197 E 134 ctrl/f 166 & 198 F 135 ctrl/g(bell) 167 ' 199 G 136 ctrl/h(backsp) 168 ( 200 H 137 ctrl/i(hortab) 169 ) 201 I 138 line feed 170 * 202 J 139 ctrl/k 171 + 203 K 140 ctrl/l(formf) 172 , 204 L 141 return 173 - 205 M 142 ctrl/n(cronly) 174 . 206 N 143 ctrl/o 175 / 207 O 144 ctrl/p 176 0 208 P 145 ctrl/q 177 1 209 Q 146 ctrl/r 178 2 210 R 147 ctrl/s 179 3 211 S 148 ctrl/t 180 4 212 T 149 ctrl/u 181 5 213 U 150 ctrl/v 182 6 214 V 151 ctrl/w 183 7 215 W 152 ctrl/x 184 8 216 X 153 ctrl/y 185 9 217 Y 154 ctrl/z(eof) 186 : 218 Z 155 ctrk/shft/k 187 ; 219 [ 156 ctrl/shft/l(esc188 < 220 \ 157 ctrl/shft/m )189 = 221 ] 158 ctrl/shft/n 190 > 222 ^ 159 ctrl/shft/o 191 ? 223 _ 253 alt mode 255 rubout FOUT(141) will output a return/line feed; FOUT(142) will output a carriage return only. Code 143,144 (ctrl/o,p) are DPF's break characters. 224 through 250 are lower-case letters. ***** miscellaneous: Expressions --- an evaluatable group of numbers or variables: (2+3*x) or (22/7) The following 3 line program will ask for 10 numbers from the reader: 10.60 open input ptr: 10.65 for X=1,10;ask a(X) 10.70 open input tty:,echo;comment --- restores terminal to normal *** command decoder: DPF calls the command decoder once after the .R DPF (or FOCAL$ in ccl) command. This permits the use under batch and this still works With only 12k (16k if the bat: handler is used to obtain Information from the batch stream). The format of the cd command string is: (or ccl) *output file(.fd)<program(.fo),input file(.fd)/options$ (or return) Options code ---------------------------------------------------- Ask command outputs a ':' /A If tty has backspace; this optimizes t : /B Chains to default run file 'fcinit.fo' /C Program is started,not only called /G Echo for input file /I No extended funtions (incl. FSQR) /N Echo for output file /O Simulated form feeds /P Ask command prints '?' /Q Ask command outputs a ringing sound /R Return to km to save current version(options) /S List .fo file on output dev.(return to KM) /W 6 decimal reduced precision mode /6 Adjust tty: page size =YYYXXXX Yyy:# of lines in page (octal) Xxxx:# of characters on line (octal) $ or return at the end of the command regulates the behaviour of DPF after the end of program execution (return to immediate mode via q command, error or break). If an alt/esc($) is given the program is automatically started and it returns to the km after it's end. Return lets DPF return to the immediate mode and a ^c must be given to return to the km. ($ and return meaning is inverted in the ccl) Line numbers --- may range from 1.01 through 31.99 but must not include integers. Variables not starting with 'a' may be used in place Of line numbers (example: 'goto X'). Group numbers are integers from 1 - 31 and reference groups of lines with 'DO', 'Write' and 'Erase' Commands. Precision --- if you choose to delete extended precision (10 digits) In the initial dialogue, you will have room for 20% more variables (234 variables without functions) Program names --- up to six alphabetic or numeric characters. Focal assumes an .fo, .fa or .fd extension (program, array or data). Program size --- with standard features of DPF Focal retained, Programs may be about 5000 characters long --- 14 blocks. Pushdown list overflow --- when too many 'do' or 'library gosub' commands have been given without a 'return', FOCAL's pushdown List becomes filled. Remedy: reduce number of blocks in program Length.(up to 350 nested do calls) Strings --- are any series of characters such as: Hello 122.5 $99.95 Now is the time for all good men .... Test34 The above strings were printed out ['122.5' is also a number] by surrounding them with quotation marks in a type statement as in line 22.25: 22.25 type "hello"! Strings may also be printed out character by character using The 'FOUT()' function; input of strings may be handled with the 'FIN()' or 'FIND()' function ---- help can review 'FIN', 'FOUT','FIND' and 'quotation marks' for you. The ask command may be used to input short strings for comparison purposes. Observe the following subroutine first written then executed: 22.78 comment: 'yes or no' subroutine 22.80 ASK "answer yes or no ? ",AN 22.82 if (AN-0yes)22.84,22.86 22.84 if (AN-0no)22.8,22.88,22.8 22.86 set X=2;return 22.88 set X=1;return *go 22.8 Answer yes or no ? Yep Answer yes or no ? Nope Answer yes or no ? Yes Program control would then return to command following subroutine Call ('DO' or 'Library Gosub') with X equal 2. Subscripting --- variables may have unique subscripts from -2048 through 2047 although the total number of variables is limited by choices made in the initial dialogue. Note that the symbol table will accurately output only the subscripts between 0 and 99. Variables --- may be one or two characters such as: A, X, Z7, P2, AB If 'ABCDEFG' were used as a variable, only 'AB' would be significant. Variables may not start with an 'F' or a digit. 120 variables are available with all features. 194 with 6 decimal precision 234 without functions and 6 decimal. DPF - error codes ------------------------- Code explanation ---------------------------------------------------------- ?AA 'all again' - start of DPF ?AB 'a break' - after ctrl/o,p break ?AC array close error ?AD array device is non-directory ?AE array (fx) exceeding established size ?AF array device full ?BA bad argument in 'for', 'set' or 'ask' ?BF bad function syntax ?BN bad name in file specification ?BO bad open command ?BM bad modify command ?CH chain error (file not found in l l command) ?DE device error (write-lock?) ?DF device full (using library save command) ?DG 'do' non-existant group ?DL 'do' non-existant line ?DD directory device is required ?DI division by zero ?EF read past end-of-file (^z:code 154) ?EO exponent overflow ?EP excess right parenthesis ?FC 'for' comma(nd) error ?FD file deletion error (l d command) ?FE function non-existant or double operators ?FN file number (subscript) to large or many ?FO format (t %) error ?GO 'go' or 'if' target line missing ?IC illegal command ?IE logical 'if' syntax error ?IG illegal group number ?IL illegal line number ?IM imaginary square root ?LF literals (variables) table full ?LI library command error ?LM logarithm minus or zero ?NA not available (operator,function,etc) ?NE no equal sign in 'for' or 'set' ?NF no file in o o " ?ND no device of that name ?NI no input file ?NO no operator before parenthesis ?NP no program (L Call,Run,Gosub) ?MO mantissa overflow ?MP missing parenthesis ?OE open output error ?OF output device full (o o ) ?PF program full ?PL program too long (l c,r,g) ?PO pushdown list overflow ------------------------------------------------------------