|
|
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: 6912 (0x1b00)
Types: TextFile
Names: »REGN.PAS«
└─⟦1230711ec⟧ Bits:30003277 Digital Research Draw v.1.0 + Skriv + Regn
└─⟦this⟧ »REGN.PAS«
└─⟦fff6648c2⟧ Bits:30004194/disk3.imd Data i Folkeskolen (Comet)
└─⟦this⟧ »REGN.PAS«
(* REGN.PAS *)
æ Dette program er en videreudvikling af programmet MICROCALC fra å
æ TURBO PASCAL å
æ The rest of the comments in this source text are in english to å
æ avoid some danish characters, which have special meaning for the å
æ compiler. å
æ This version can with very few changes be compiled to a running å
æ program on both 8-bit and 16-bit machines using a POLY-PASCAL å
æ compiler. å
æ If you should be interested in the compability problem, here is a å
æ lot of hints on how to make a program movable from one machine to å
æ another. å
æ The source consists of 6 seperate files: å
æ REGNDEF.PAS REGN.PAS REGN1.PAS REGN2.PAS REGN3.PAS REGN4.PAS å
æ REGN.PAS, REGN2.PAS, REGN3.PAS and REGN4.PAS are made to be as å
æ nearly machine independent as possible. å
æ REGNDEF.PAS consists of definitions regarding special keys and å
æ strings to be sent to the terminal. å
æ REGN1.PAS is the file in which all the 8-bit/16-bit differences å
æ are. These can be changed from one to the other by changing the å
æ position of the remark signs. å
æ This file also have a procedure in which function keys can be set å
æ up to send the desired strings. Special characters can be made å
æ here as well. å
æ If you should be in need of more free memory some of the procedu- å
æ res in file REGN4.PAS are marked for suitable as overlayes å
æ The group, which have made this particular version of REGN, does å
æ not want to have any responsibility for other versions of the å
æ program, which should be made by using this particular source text.å
æ We kindly request, that you use another name for your own version! å
æ This program is donated to the public domain for å
æ non commercial use only. Donated by TURBO PASCAL å
PROGRAM REGN; (*$R-,U-,A+,C-*)
const
maxtegn = 77; æ maximum length of string å
tom:stringÆmaxtegnÅ=' ';
fxmax: char = 'G'; æ maximum number of columns in spread sheet å
fymax = 21; æ maximum number of lines in spread sheet å
normwidth = 11; æ default width of coloumn å
(*$I REGNDEF.PAS*) æ machine- and system dependend procedures å
æ see also Include file REGN1.PAS å
type
str11 = stringÆ11Å;
str14 = stringÆ14Å;
str30 = stringÆ30Å;
str33 = stringÆ33Å;
anystring = stringÆmaxtegnÅ;
str128 = stringÆ128Å;
sheetindex = 'A'..'G';
attributes = (constant,formula,txt,overwritten,locked,calculated,onscreen);
æ the spreadsheet is made out of cells - every cell is defined as å
æ the following record: å
cellrec = record
cellstatus: set of attributes; æ status of cell (see type def.) å
contents: stringÆmaxtegnÅ; æ contains a formula or some text å
value: real; æ last calculated cell value å
dec,fw: 0..maxtegn; æ decimals and cell whith å
end;
cells = arrayÆsheetindex,1..fymaxÅ of cellrec;
const
xpos: arrayÆsheetindexÅ of integer = (2,13,24,35,46,57,68);
æ NOTE this is for PASCAL with upper left corner in position (0,0)å
æ the numbers are related to normwidth å
points:str33='.................................';
æ Line to be written, when calculation is impossible å
var
sheet: cells; æ definition of the spread sheet å
fx: sheetindex; æ column of current cell å
fy: integer; æ line of current cell å
forladt: sheetindex; æ last column å
upfx: sheetindex; æ column under update å
upfy: integer; æ line under update å
ch: char; æ last read character å
mcfile: file of cellrec; æ file to store sheets in å
tekstfil: text; æ file for writing sheets å
autocalc: boolean; æ recalculate after each entry? å
slut: boolean; æ control for end of program å
retning: byte; æ default cursor movement direct.å
indicator: char; æ arrows to point the direction å
errmessage: arrayÆ1..15Å of str30; æ errormessages å
filofs,filseg: integer;
beregnet: boolean; æ to test for emty cells å
repeteret: boolean; æ to test for repetition å
eline: anystring; æ temporary string å
(*$I REGN1.PAS*) æ machine- and system dependend procedures å
æ see also REGNDEF.PAS å
(*$I REGN2.PAS*)
(*$I REGN3.PAS*)
(*$I REGN4.PAS*)
æ*********************************************************************å
æ* this is where the program starts executing *å
æ*********************************************************************å
begin
TASTER;
CURSOR(false);
INIT;
WELLCOME;
MENU;
if not slut then begin
GOTOCELL(fx,fy);
ch:=@0;
repeat
if ch<>return then ch:=KEY;
case ch of
op: MOVEUP;
ned: MOVEDOWN;
hoejre: MOVERIGHT;
venstre: MOVELEFT;
omregn:begin
RECALCULATE(true);
gotoxy(0,23);write(clreol);
GOTOCELL(fx,fy);
end;
return:begin
case retning of
0:MOVERIGHT;
1:MOVEDOWN;
2:MOVELEFT;
3:MOVEUP;
end;
ch:=@0;
end;
'/':begin
COMMANDS;
ch:=@0;
end;
esc: GETCELL(fx,fy);
otherwise
if ch in Æ' '..'ü'Å then GETCELL(fx,fy);
end;
if slut then begin
gotoxy(0,23);
write(clreol,@7,'Skal programmet afbrydes nu? J/N ');
repeat
ch:=UPCASE(KEY);
until ch in Æ'J','N'Å;
write(ch);
if ch='N' then begin
slut:=false;
FLASH(37,' Tast / for kommando ',false);
gotoxy(0,23);write(clreol);
GOTOCELL(fx,fy);
end;
end;
until slut;
end;
AFSLUT;
CURSOR(true);
end.
«eof»