home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Tu-Basic / MC0.INC < prev    next >
Text File  |  1987-04-01  |  4KB  |  126 lines

  1. '┌───────────────────────────────────────────────────────────────────────────┐
  2. '│                               MC.BAS                                   │
  3. '│                             VERSION 1.0                                   │
  4. '│                                                                           │
  5. '│                           MODULE: MC0.INC                                 │
  6. '│                                                                           │
  7. '│                   Turbo Basic                     │
  8. '│        (C) Copyright 1987 by Borland International             │
  9. '│                                                                           │
  10. '│ DESCRIPTION: This module contains the global named constant and dim         │
  11. '│              statements used in the program MicroCalc                     │
  12. '│                                                                           │
  13. '└───────────────────────────────────────────────────────────────────────────┘
  14.  
  15.   %FALSE      = 0
  16.   %TRUE       = 1
  17.   NoPutReal#  = 99999.99
  18.  
  19.   %FxMin    = 65 ' lower column dimension of spreadsheet data structure
  20.   %FxMax    = 71 ' upper column dimension of spreadsheet data structure
  21.   %FyMin    = 1  ' lower line dimension of spreadsheet data structure
  22.   %FyMax    = 21 ' upper line dimension of spreadsheet data structure
  23.   %RecSize  = 79 ' size of record in spreadsheet data structure
  24.  
  25.   %CellStatusOfs  = 1   ' these constants represent the offsets in the
  26.   %ContentsOfs    = 2   ' records in the spreadsheet, from which we must
  27.   %ValueOfs       = 73  ' retrieve individual fields
  28.   %DecOfs         = 77  '
  29.   %FwOfs          = 78  '
  30.   %ColorOfs       = 79
  31.  
  32.   %FieldWidth     = 11
  33.   %NumDecPlaces   =  2
  34.   %ContentsLen    = 70 ' the length of the string contents in the record
  35.  
  36.   ' declare the data structure used to represent our spreadsheet
  37.   dim SpreadSheet%(%FxMin:%FxMax , %FyMin:%FyMax , 1:%RecSize )
  38.  
  39.   ' spreadsheet record global variables
  40.   CellStatus% = -1
  41.   Contents$   = chr$(0)
  42.   Value#      = NoPutReal#
  43.   Dec%        = -1
  44.   Fw%         = -1
  45.  
  46.   ' cell status set
  47.   %Constant    =  1
  48.   %Formula     =  2
  49.   %Txt         =  4
  50.   %OverWritten =  8
  51.   %Locked      = 16
  52.   %Calculated  = 32
  53.  
  54.   %SheetSize   = 23226
  55.   %ScreenSize  = 80
  56.   %FlashLine   = 23
  57.   %StatusLine  = 24
  58.  
  59.   GlobFX% = 0
  60.   GlobFY% = 0
  61.  
  62.   Form% = %FALSE
  63.  
  64.   %CellWidth =11
  65.  
  66.   dim Xpos%(%FxMin:%FxMax ) ' declare an array to hold the column positions
  67.  
  68.     Xpos%(%FxMin )     = 3   ' initialize the array that holds the column
  69.     Xpos%(%FXMin  + 1) = 14  ' positions of the cells
  70.     Xpos%(%FXMin  + 2) = 25
  71.     Xpos%(%FXMin  + 3) = 36
  72.     Xpos%(%FXMin  + 4) = 47
  73.     Xpos%(%FXMin  + 5) = 58
  74.     Xpos%(%FXMin  + 6) = 69
  75.  
  76.  
  77.   ' Standard Functions
  78.  
  79.     %Fabs     = 0
  80.     %Fsqrt    = 1
  81.     %Fsqr     = 2
  82.     %Fsin     = 3
  83.     %Fcos     = 4
  84.     %Farctan  = 5
  85.     %Fln      = 6
  86.     %Flog     = 7
  87.     %Fexp     = 8
  88.     %Fint     = 9
  89.     %Fsgn     =10
  90.     %Frnd     =11
  91.     %Ffact    =12
  92.  
  93.     dim StandardFunction$(%Fabs:%Ffact )
  94.  
  95.     StandardFunction$(%Fabs )    = "ABS"
  96.     StandardFunction$(%Fsqrt )   = "SQRT"
  97.     StandardFunction$(%Fsqr )    = "SQR"
  98.     StandardFunction$(%Fsin )    = "SIN"
  99.     StandardFunction$(%Fcos )    = "COS"
  100.     StandardFunction$(%Farctan ) = "ARCTAN"
  101.     StandardFunction$(%Fln )     = "LN"
  102.     StandardFunction$(%Flog )    = "LOG"
  103.     StandardFunction$(%Fexp )    = "EXP"
  104.     StandardFunction$(%Fint )    = "INT"
  105.     StandardFunction$(%Fsgn )    = "SGN"
  106.     StandardFunction$(%Frnd )    = "RND"
  107.     StandardFunction$(%Ffact )   = "FACT"
  108.  
  109.     Numbers$="0123456789"
  110.  
  111.   ' Miscellaneous
  112.  
  113.   %NormColor  = 14       ' Screen colors
  114.   %LowColor   =  7
  115.   %Blinkcolor = 30
  116.   %HighLightColor = 15
  117.  
  118.   %EditKey     = 2
  119.   EditCellMode%= %False
  120.  
  121.   Enter$      = chr$(17)+chr$(196)+chr$(217)  ' the enter key
  122.   EofLine$    = chr$(13)                      ' end of line character
  123.   CalcExit%   = %False                        ' To escape from the calc
  124.   AutoCalc%   = %True
  125.   Border%     = %True
  126.