home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / basic / booklook.bi < prev    next >
Encoding:
Text File  |  1989-11-09  |  6.2 KB  |  137 lines

  1. DEFINT A-Z
  2. ' Define constants for TRUE and FALSE
  3. CONST FALSE = 0, TRUE = NOT FALSE
  4.  
  5. ' Define constants for the database file & table names
  6. CONST cBookStockTableNum = 1, cCardHoldersTableNum = 2, cBooksOutTableNum = 3
  7. CONST cDisplayedTables = 2
  8.  
  9. ' Define names similar to keyboard names with their equivalent key codes.
  10. CONST SPACE = 32, ESC = 27, ENTER = 13, TABKEY = 9, ESCAPE = 27, BACKSPACE = 8
  11. CONST DOWN = 80, UP = 72, LEFT = 75, RIGHT = 77
  12. CONST HOME = 71, ENDK = 79, PGDN = 81, PGUP = 73
  13. CONST INS = 82, DEL = 83, NULL = 0, EMPTYSTRING = ""
  14. CONST CTRLU = 21
  15.  
  16. ' Define English names for color-specification numbers. Add BRIGHT to
  17. ' any color to get bright version.
  18. CONST BLACK = 0, BLUE = 1, GREEN = 2, CYAN = 3, RED = 4, MAGENTA = 5
  19. CONST YELLOW = 6, WHITE = 7, BRIGHT = 8
  20.  
  21. ' Assign colors to different kinds of text. By changing the color assigned,
  22. ' you can change the color of the display. The initial colors are
  23. ' chosen because they work for color or black-and-white displays.
  24. CONST BACKGROUND = BLACK, NORMAL = WHITE, HILITE = WHITE + BRIGHT
  25. CONST FOREGROUND = CYAN
  26.  
  27. ' Screen positions - Initialized for 25 rows. Screen positions can be
  28. ' modified for 43-row mode if you have an EGA or VGA adapter.
  29.  
  30. CONST TABLETOP = 1, TABLEEND = 14
  31. CONST BOXTOP = 16, NLINE = 17, RLINE = 18, WLINE = 19, VLINE = 20, ALINE = 21
  32. CONST ELINE = 22, CLINE = 23, BOXEND = 24, INDBOX = 42, HELPCOL = 1
  33.                                   
  34. CONST SCREENWIDTH = 74
  35.  
  36. CONST MESBOXTOP = TABLEEND, MESFIELD = TABLEEND + 1
  37. CONST MESBOXEND = BOXTOP
  38.  
  39. CONST DATATOP = 2, DATAEND = 13, NAMEFIELD = 3, TITLEFIELD = 3
  40. CONST STREETFIELD = 5, AUTHORFIELD = 5, CITYFIELD = 7, PUBFIELD = 7
  41. CONST STATEFIELD = 9, EDFIELD = 9, ZIPFIELD = 11, PRICEFIELD = 11
  42. CONST CARDNUMFIELD = 13, IDFIELD = 13
  43.  
  44. CONST QUIT = 0, GOAHEAD = 1, GOBACK = 2, BORROWER = 3, WHICHBOOKS = 4
  45. CONST SEEKFIELD = 5, REORDER = 6, STATUS = 7, OTHERTABLE = 8, TOSSRECORD = 9
  46. CONST ADDRECORD = 10, CHECKOUT = 11, CHECKIN = 12
  47. CONST EDITRECORD = 13, UNDO = 14, UNDOALL = 15, INVALIDKEY = 16
  48.  
  49. CONST BIGINDEX = 20, NULLINDEX = 21
  50.  
  51. CONST KEYSMESSAGE = " Press one of the Viewing/Editing keys  "
  52.  
  53. TYPE BookStatus
  54.   IDnum     AS DOUBLE
  55.   CardNum   AS LONG
  56.   DueDate   AS DOUBLE
  57. END TYPE
  58. TYPE Borrowers
  59.   CardNum         AS LONG
  60.   Zip             AS LONG
  61.   TheName         AS STRING * 36
  62.   City            AS STRING * 26
  63.   Street          AS STRING * 50
  64.   State           AS STRING * 2
  65. END TYPE
  66.  
  67. TYPE Books
  68.   IDnum     AS DOUBLE
  69.   Price     AS CURRENCY
  70.   Edition   AS INTEGER
  71.   Title     AS STRING * 50
  72.   Publisher AS STRING * 50
  73.   Author    AS STRING * 36
  74. END TYPE
  75.  
  76. TYPE RecStruct                  ' This structure contains each of the other
  77.   TableNum    AS INTEGER        ' other table structures. When you pass a
  78.   WhichIndex  AS STRING * 40    ' reference to this structure to procedures
  79.   Inventory   AS Books          ' the procedure decodes the TableNum
  80.   Lendee      AS Borrowers      ' element, then deals with the proper table.
  81.   OutBooks    AS BookStatus     ' WhichIndex is used to communicate the index
  82. END TYPE                        ' the user wants to set.
  83.  
  84. DECLARE SUB BooksBorrowed (TablesRec AS ANY)
  85. DECLARE SUB ShowRecord (TablesRec AS ANY)
  86. DECLARE SUB ShowIt (TablesRec AS RecStruct, WhichIndex$, WhichTable%, StringToShow$)
  87. DECLARE SUB UserChoice (BigRec AS RecStruct, Row%, Column%, Feedback$)
  88. DECLARE SUB DrawHelpBox ()
  89. DECLARE SUB BooksOutBox (OutBookNames() AS STRING, Header$, Footer$, BiggestYet%, Num%)
  90. DECLARE SUB CheckPosition (BigRec AS RecStruct, Answer%, DimN%, DimP%)
  91. DECLARE SUB EditCheck (Pending%, Task%, TablesRec AS RecStruct)
  92. DECLARE SUB LendeeProfile (TablesRec AS RecStruct)
  93. DECLARE SUB Retriever (BigRec AS RecStruct, DimN%, DimP%, Task%)
  94. DECLARE SUB ClearEm (TableNum%, Field1%, Field2%, Field3%, Field4%, Field5%, Field6%)
  95. DECLARE SUB EraseMessage ()
  96. DECLARE SUB Indexbox (TablesRec AS RecStruct, MoveDown%)
  97. DECLARE SUB MakeOver (BigRec AS RecStruct)
  98. DECLARE SUB ShowKeys (TablesRec AS RecStruct, ForeGrnd%, TableDone%, TableStart%)
  99. DECLARE SUB ShowMessage (Message$, Cursor%)
  100. DECLARE SUB GetKeyVals (TablesRec AS ANY, Key1$, Key2$, Key3#, Letter$)
  101. DECLARE SUB GetKeyVals (TablesRec AS ANY, Key1$, Key2$, Key3#, Letter$)
  102. DECLARE SUB TossKey ()
  103. DECLARE SUB DrawHelpKeys (TableNum AS INTEGER)
  104. DECLARE SUB DrawIndexBox (TableNum AS INTEGER, Task%)
  105. DECLARE SUB DrawScreen (TableNum AS INTEGER)
  106. DECLARE SUB DrawTable (TableNum AS INTEGER)
  107. DECLARE SUB AdjustIndex (TablesRec AS RecStruct)
  108. DECLARE SUB SeekRecord (TablesRec AS RecStruct, TempRec AS RecStruct, Letter$)
  109. DECLARE SUB ShowStatus (Stat$, ValueToShow AS DOUBLE)
  110. DECLARE SUB ReturnBook (TablesRec AS RecStruct, DueDate#)
  111. DECLARE SUB BorrowBook (TablesRec AS RecStruct)
  112. DECLARE SUB PeekWindow (OutBookNames() AS STRING, Header$, Footer$, BiggestYet%)
  113. DECLARE SUB DupeFixer (BigRec AS ANY)
  114. DECLARE FUNCTION CatchKey% ()
  115. DECLARE FUNCTION ValuesOK% (BigRec AS ANY, Key1$, Key2$, ValueToSeek$)
  116. DECLARE FUNCTION RetrieveFailure% (ErrorNum%, Origin$)
  117. DECLARE FUNCTION TransposeName$ (TheName AS STRING)
  118. DECLARE FUNCTION ReturnKey$ ()
  119. DECLARE FUNCTION GetStatus% (TablesRec AS RecStruct, DateToShow#)
  120. DECLARE FUNCTION ChangeRecord% (FirstLetter$, Argument%, TablesRec AS RecStruct, Task AS INTEGER)
  121. DECLARE FUNCTION CheckIndex% (TablesRec AS RecStruct, FirstTime%)
  122. DECLARE FUNCTION ConfirmEntry% (Letter$)
  123. DECLARE FUNCTION EdAddCursor% (NextField%, Job%, TablesRec AS RecStruct, FirstShot%)
  124. DECLARE FUNCTION EditField% (Argument%, TablesRec AS RecStruct, FirstLetter$, Task%, Answer%)
  125. DECLARE FUNCTION GetInput% (BigRec AS RecStruct)
  126. DECLARE FUNCTION GetOperand% (HoldOperand$)
  127. DECLARE FUNCTION HighKeys% (Answer AS STRING)
  128. DECLARE FUNCTION MakeString$ (FilterTrap AS INTEGER, Prompt$)
  129. DECLARE FUNCTION OrderCursor% (Index%, NextField%, Job%, TablesRec AS RecStruct, Letter$)
  130. DECLARE FUNCTION PlaceCursor% (WhichField%, TablesRec AS RecStruct, FirstLetter$, FirstTime AS INTEGER, Task AS INTEGER)
  131. DECLARE FUNCTION Reader% (BigRec AS RecStruct, SeqFile%)
  132. DECLARE FUNCTION AddOne% (BigRec AS RecStruct, EmptyRec AS RecStruct, TempRec AS RecStruct, Answer%)
  133. DECLARE FUNCTION ChooseOrder% (BigRec AS RecStruct, EmptyRec AS RecStruct, TempRec AS RecStruct, FirstLetter$, Task%)
  134. DECLARE FUNCTION ReturnKey$ ()
  135. DECLARE FUNCTION Borrowed ()
  136.  
  137.