|
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 - download
Length: 3200 (0xc80) Types: TextFile Names: »MC-MOD02.INC«
└─⟦d482c3728⟧ Bits:30005987 Turbo Pascal v2.00A (Jet80) └─ ⟦this⟧ »MC-MOD02.INC«
æ.PAå æ*******************************************************************å æ* SOURCE CODE MODULE: MC-MOD02 *å æ* PURPOSE: Display values in cells and move between *å æ* cells in the spread sheet. *å æ*******************************************************************å procedure FlashType; begin with ScreenÆFX,FYÅ do begin GotoXY(1,23); Write(FX,FY:2,' '); if Formula in CellStatus then write('Formula:') else if Constant in CellStatus then Write('Numeric ') else if Txt in CellStatus then Write('Text '); GotoXY(1,24); ClrEol; if Formula in CellStatus then Write(Contents); end; end; æ The following procedures move between the Cells on the calc sheet.å æ Each Cell has an associated record containing its X,Y coordinates å æ and data. See the type definition for "Cell". å procedure GotoCell(GX: ScreenIndex; GY: integer); begin with ScreenÆGX,GYÅ do begin HighVideo; GotoXY(XPosÆGXÅ,GY+1); Write(' '); GotoXY(XPosÆGXÅ,GY+1); if Txt in CellStatus then Write(Contents) else begin if DEC>=0 then Write(Value:FW:DEC) else Write(Value:FW); end; FlashType; GotoXY(XPosÆGXÅ,GY+1); end; LowVideo; end; æ.CP20å procedure LeaveCell(FX:ScreenIndex;FY: integer); begin with ScreenÆFX,FYÅ do begin GotoXY(XPosÆFXÅ,FY+1); LowVideo; if Txt in CellStatus then Write(Contents) else begin if DEC>=0 then Write(Value:FW:DEC) else Write(Value:FW); end; end; end; æ.CP20å procedure Update; var UFX: ScreenIndex; UFY: integer; begin ClrScr; Grid; for UFX:='A' to FXMax do for UFY:=1 to FYMax do if ScreenÆUFX,UFYÅ.Contents<>'' then LeaveCell(UFX,UFY); GotoCell(FX,FY); end; æ.CP20å procedure MoveDown; var Start: integer; begin LeaveCell(FX,FY); Start:=FY; repeat FY:=FY+1; if FY>FYMax then FY:=1; until (ScreenÆFX,FYÅ.CellStatus*ÆOverWritten,LockedÅ=ÆÅ) or (FY=Start); if FY<>Start then GotoCell(FX,FY); end; æ.CP20å procedure MoveUp; var Start: integer; begin LeaveCell(FX,FY); Start:=FY; repeat FY:=FY-1; if FY<1 then FY:=FYMax; until (ScreenÆFX,FYÅ.CellStatus*ÆOverWritten,LockedÅ=ÆÅ) or (FY=Start); if FY<>Start then GotoCell(FX,FY); end; æ.CP20å procedure MoveRight; var Start: ScreenIndex; begin LeaveCell(FX,FY); Start:=FX; repeat FX:=Succ(FX); if FX>FXMax then begin FX:='A'; FY:=FY+1; if FY>FYMax then FY:=1; end; until (ScreenÆFX,FYÅ.CellStatus*ÆOverWritten,LockedÅ=ÆÅ) or (FX=Start); if FX<>Start then GotoCell(FX,FY); end; æ.CP20å procedure MoveLeft; var Start: ScreenIndex; begin LeaveCell(FX,FY); Start:=FX; repeat FX:=Pred(FX); if FX<'A' then begin FX:=FXMax; FY:=FY-1; if FY<1 then FY:=FYMax; end; until (ScreenÆFX,FYÅ.CellStatus*ÆOverWritten,LockedÅ=ÆÅ) or (FX=Start); if FX<>Start then GotoCell(FX,FY); end; «eof»