DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦9b8bafd22⟧ TextFile

    Length: 3634 (0xe32)
    Types: TextFile
    Names: »MCALC.PAS«

Derivation

└─⟦505fbc898⟧ Bits:30002732 Turbo Pascal 5.0 for C-DOS Partner
    └─⟦this⟧ »MCALC\MCALC.PAS« 

TextFile


æ Copyright (c) 1985, 88 by Borland International, Inc. å

Program MCalc;

uses Crt, Dos, MCVars, MCUtil, MCDisply, MCParser, MCLib, MCInput, MCommand;

var
  Ch : Char;

procedure Run;
æ The main program loop å
var
  Input : Char;
begin
  Stop := False;
  ClearInput;
  repeat
    DisplayCell(CurCol, CurRow, HIGHLIGHT, NOUPDATE);
    CurCell := CellÆCurCol, CurRowÅ;
    ShowCellType;
    GotoXY(1, 25);
    Input := GetKey;
    case Input of
      '/' : MainMenu;
      F1 : Recalc;
      F2 : EditCell(CurCell);
      DELKEY : begin
        DeleteCell(CurCol, CurRow, UPDATE);
        PrintFreeMem;
        if AutoCalc then
          Recalc;
      end; æ DELKEY å
      PGUPKEY : begin
        if CurRow <= SCREENROWS then
        begin
          CurRow := 1;
          TopRow := 1;
        end
        else if TopRow <= SCREENROWS then
        begin
          CurRow := Succ(CurRow - TopRow);
          TopRow := 1;
        end
        else begin
          Dec(TopRow, SCREENROWS);
          Dec(CurRow, SCREENROWS);
        end;
        SetBottomRow;
        DisplayScreen(NOUPDATE);
      end; æPGUPKEY å
      PGDNKEY : begin
        Inc(TopRow, SCREENROWS);
        Inc(CurRow, SCREENROWS);
        if (CurRow > MAXROWS) and (TopRow > MAXROWS) then
        begin
          CurRow := MAXROWS;
          TopRow := Succ(MAXROWS - SCREENROWS);
        end
        else if TopRow > Succ(MAXROWS - SCREENROWS) then
        begin
          CurRow := Succ(CurRow) - (TopRow + SCREENROWS - MAXROWS);
          TopRow := Succ(MAXROWS - SCREENROWS);
        end;
        SetBottomRow;
        DisplayScreen(NOUPDATE);
      end; æ PGDNKEY å
      CTRLLEFTKEY : begin
        DisplayCell(CurCol, CurRow, NOHIGHLIGHT, NOUPDATE);
        if LeftCol = 1 then
          CurCol := 1
        else begin
          CurCol := Pred(LeftCol);
          RightCol := CurCol;
          SetLeftCol;
          SetRightCol;
          DisplayScreen(NOUPDATE);
        end;
      end; æ CTRLLEFTKEY å
      CTRLRIGHTKEY : begin
        DisplayCell(CurCol, CurRow, NOHIGHLIGHT, NOUPDATE);
        if RightCol = MAXCOLS then
          CurCol := RightCol
        else begin
          CurCol := Succ(RightCol);
          LeftCol := CurCol;
          SetRightCol;
          SetLeftCol;
          DisplayScreen(NOUPDATE);
        end;
      end; æ CTRLRIGHTKEY å
      HOMEKEY : begin
        CurRow := 1;
        CurCol := 1;
        LeftCol := 1;
        TopRow := 1;
        SetRightCol;
        SetBottomRow;
        DisplayScreen(NOUPDATE);
      end; æ HOMEKEY å
      ENDKEY : begin
        CurCol := LastCol;
        RightCol := CurCol;
        BottomRow := LastRow;
        CurRow := BottomRow;
        SetTopRow;
        SetLeftCol;
        SetRightCol;
        DisplayScreen(NOUPDATE);
      end; æ ENDKEY å
      UPKEY : MoveRowUp;
      DOWNKEY : MoveRowDown;
      LEFTKEY : MoveColLeft;
      RIGHTKEY : MoveColRight;
      else if Input in Æ' '..'ü'Å then
        GetInput(Input);
    end; æ case å
  until Stop;
end; æ Run å

begin
  CheckBreak := False;
  SetColor(TXTCOLOR);
  ClrScr;
  SetColor(MSGHEADERCOLOR);
  WriteXY(MSGHEADER, (80 - Length(MSGHEADER)) shr 1, 10);
  SetColor(PROMPTCOLOR);
  WriteXY(MSGKEYPRESS, (80 - Length(MSGKEYPRESS)) shr 1, 12);
  GotoXY(80, 25);
  Ch := GetKey;
  ClrScr;
  InitVars;
  Changed := False;
  RedrawScreen;
  if (ParamCount > 0) then
    LoadSheet(ParamStr(1));
  ClearInput;
  Run;
  SetColor(LightGray);
  TextMode(OldMode);
  SetCursor(OldCursor);
end.
«eof»