home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / FLDIO1.ZIP / FIELDIO.DOC < prev    next >
Encoding:
Text File  |  1988-02-16  |  40.5 KB  |  753 lines

  1. {$v-}
  2. unit Fieldio;
  3.  
  4. interface                         { FIELDIO.TPU a Turbo Pascal (R) unit }
  5.                                   { for field input and output          }
  6. uses
  7.   Crt,                            { version 1.0                         }
  8.   Dos;                            { Copyright (c) 1988 by W. Lee Passey }
  9.                                   { All rights reserved
  10.  
  11.  
  12.  
  13.      FieldIO is a separately compiled unit for Turbo Pascal ver. 4.0 from
  14. Borland International, Inc. FieldIO may be linked to a user's source pro-
  15. grams, and will provide routines for "Bullet Proof" data entry.
  16.      What  follows is a copy of the FieldIO interface section, with  each
  17. procedure and significant variable annotated as to its function and use.
  18. }
  19.  
  20. type
  21.   String5  = string[5];
  22.   String10 = string[10];
  23.   String15 = string[15];
  24.   String20 = string[20];
  25.   String25 = string[25];
  26.   String30 = string[30];
  27.   String35 = string[35];
  28.   String40 = string[40];
  29.   String45 = string[45];
  30.   String50 = string[50];
  31.   String55 = string[55];
  32.   String60 = string[60];
  33.   String65  = string[65];
  34.   String70 = string[70];
  35.   String75 = string[75];
  36.   String80 = string[80];
  37.   String85 = string[85];
  38.   String90 = string[90];
  39.   String130 = string[130];
  40.   String150 = string[150];
  41.   datetype = string[9];
  42.  
  43.   setofchar = set of char;
  44.  
  45.   wordpointer = ^wordheap;              { These are the variable types  }
  46.   wordheap = record                     { for a linked list of words or }
  47.                NextWord,                { phrases on the heap.  They    }
  48.                PrevWord : wordpointer;  { used by the 'DisplayWords'    }
  49.                Word     : string[25];   { and 'GetList' routines.       }
  50.                end;
  51.  
  52.   TextRec = record                      { This is the record type for   }
  53.               NextRec   : longint;      { the help file.  Record zero   }
  54.               case byte of              { contains a header array for   }
  55.                 0 : (Text               { the first 30 help screens (0  }
  56.                      : string[123]);    { is unused in the first header,}
  57.                 1 : (Header
  58.                      : array [0 .. 30] of longint);
  59.                 end;
  60.                                         { although it is in subsequent  }
  61.                                         { headers) where each element   }
  62.                                         { in the array is the first     }
  63.                                         { record of of the correspond-  }
  64.                                         { ing help screen.  For header  }
  65.                                         { records, 'NextRec' points to  }
  66.                                         { the next header and for text  }
  67.                                         { records it points to the next }
  68.                                         { text.  Text is automatically  }
  69.                                         { word wrapped when displayed,  }
  70.                                         { so all text records, except   }
  71.                                         { the last on each screen,      }
  72.                                         { should be packed with a full  }
  73.                                                           { 123 bytes.  }
  74.  
  75. const                { constants for cursor control keys - mostly self- }
  76.   Up      = ^E;                                           { explanatory }
  77.   Down    = ^X;
  78.   Right   = ^D;
  79.   Left    = ^S;
  80.   WdRt    = ^F;
  81.   WdLt    = ^A;
  82.   ScUp    = ^Z;
  83.   ScDn    = ^W;
  84.   Ret     = ^M;
  85.   InLin   = ^N;
  86.   PgUp    = ^R;
  87.   PgDn    = ^C;
  88.   Reform  = ^B;
  89.   Esc     = #27;
  90.   Del     = #127;
  91.   DelFd   = ^G;
  92.   DelWd   = ^T;
  93.   DelLn   = ^Y;
  94.   Space   = #32;
  95.   Null    = #0;
  96.   Tab     = ^I;
  97.   BkSp    = ^H;
  98.   HelpKey = #187;   { These three numbers are the return codes for      }
  99.   Home    = #199;   { these keys with the high bit set.  GetChar sets   }
  100.   EndKey  = #207;   { the high bit for all extended key codes.          }
  101.  
  102.   TB  : char = #205;  { These characters are used to create the top,    }
  103.   SID : char = #186;  { bottom (TB), sides (SID) and each of the four   }
  104.   TLC : char = #201;  { corners (TLC, TRC, BLC, BRC) of the help window }
  105.   TRC : char = #187;  { border.  They can be changed to whatever you    }
  106.   BLC : char = #200;  { like.  These values make a double border.       }
  107.   BRC : char = #188;
  108.  
  109.   AllChars : setofchar = [' ' .. '}'];
  110.   ControlSet : setofchar = [^A .. ^Z, Esc, Del];
  111.   NumChars : setofchar = ['0' .. '9'];
  112.   NameChars : setofchar = ['A' .. 'Z', 'a' .. 'z', '-', '.', '_'];
  113.   SpaceChars : setofchar = [' ', '-', '/', ','];
  114.  
  115.   BeepOnError : boolean = false;        { When this variable is true,   }
  116.                                         { an unacceptable response,     }
  117.                                         { e.g. a letter in a number     }
  118.                                         { field, will cause the speaker }
  119.                                         { to beep.  }
  120.  
  121.   NoFuture : boolean = false;           { When this variable is true,   }
  122.                                         { the GetDateStr routine will   }
  123.                                         { not accept a future date,     }
  124.                                         { i.e. one in advance of the    }
  125.                                         { 'TodaysDate', which is init-  }
  126.                                         { ialized by this unit to the   }
  127.                                         { system date.  }
  128.  
  129.   InsertOn : boolean = false;           { When this variable is true,   }
  130.                                         { newly added characters will   }
  131.                                         { be inserted into the field at }
  132.                                         { the cursor position.  When    }
  133.                                         { false, overwriting occurs.  }
  134.  
  135.   Escape : boolean = false;             { This variable will be set to  }
  136.                                         { true whenever the escape key  }
  137.                                         { is pressed, and reset to      }
  138.                                         { false whenever any other key  }
  139.                                         { is pressed.  Note: most of    }
  140.                                         { following routines stop col-  }
  141.                                         { lecting characters and return }
  142.                                         { when this occurs. }
  143.  
  144.   ErrMsg : boolean = false;             { This variable will be set to  }
  145.                                         { true if an error message was  }
  146.                                         { printed on the last line of   }
  147.                                         { the screen.  These messages   }
  148.                                         { get cleared upon the next     }
  149.                                         { key-press. }
  150.  
  151.   Reference : boolean = false;          { When this variable is true,   }
  152.                                         { the last sentence of a help   }
  153.                                         { screen is considered to be a  }
  154.                                         { reference (to the manual,     }
  155.                                         { etc.) and will be printed in  }
  156.                                         { the lower right corner of the }
  157.                                         { help screen.  If the last     }
  158.                                         { sentence is the single char-  }
  159.                                         { acter '#', the number of the  }
  160.                                         { help screen will be displayed.}
  161.  
  162.   RefMark : string15 = '#-';            { If the option to print help   }
  163.                                         { screen numbers is selected,   }
  164.                                         { this short string will be     }
  165.                                         { displayed on the last help    }
  166.                                         { line, immediately before the  }
  167.                                         { help screen number.           }
  168.  
  169.   Hercules : boolean = true;            { This variable is used to in-  }
  170.                                         { dicate the presence of a Mono }
  171.                                         { graphics adapter in the sys-  }
  172.                                         { tem (not necessarily Herc-    }
  173.                                         { ules).  When true, the saved  }
  174.                                         { portion of the screen is      }
  175.                                         { saved in extra memory on the  }
  176.                                         { card, beginning at offset     }
  177.                                         { $1000, rather than in main    }
  178.                                         { memory.  This storage will    }
  179.                                         { always take place for CGA     }
  180.                                         { cards, regardless of the      }
  181.                                         { value of this variable.  Set  }
  182.                                         { this to true for EGA cards.   }
  183.  
  184.   StartField : char = '>';              { Characters used to mark a     }
  185.   EndField   : char = '<';              { field when selected for input }
  186.  
  187.   HelpFG : byte = 7;                    { Foreground color for the help }
  188.                                                              { windows. }
  189.   HelpBG : byte = 0;                    { Background color for help.    }
  190.   BordFG : byte = 7;                    { Forground color for the help  }
  191.                                                       { window border.  }
  192.   BordBG : byte = 0;                    { Border background color.      }
  193.                                         { Defaults are for monochrome   }
  194. var
  195.   TodaysDate : datetype;
  196.   HelpFileName : string15;              { Store here the name of your   }
  197.                                         { help file, before calling     }
  198.                                                                 { Help. }
  199.  
  200.   ScreenWidth  : byte absolute $0040:$004A;         { the screen width  }
  201.                                                     { as set by mode.   }
  202.  
  203.   screenlength : byte;                  { This variable is initialized  }
  204.                                         { by this unit to 25.           }
  205.  
  206. (************************************************************************
  207. *                                                                       *
  208. *                             CHARSTRING                                *
  209. *                                                                       *
  210. *     This function returns a string of the character passed having a   *
  211. *     length equal to the Number passed.                                *
  212. *                                                                       *
  213. ************************************************************************)
  214.  
  215. function CharString (Character : char;
  216.                      Number    : byte) : String;
  217.  
  218.  
  219. (************************************************************************
  220. *                                                                       *
  221. *                              TRIMLENGTH                               *
  222. *                                                                       *
  223. *     This function returns the length of a string, not including       *
  224. *     trailing spaces or carriage returns.                              *
  225. *                                                                       *
  226. ************************************************************************)
  227.  
  228. function TrimLength (line : string) : byte;
  229.  
  230.  
  231. (************************************************************************
  232. *                                                                       *
  233. *                                ALLCAPS                                *
  234. *                                                                       *
  235. *     This function returns a string identical to the string passed,    *
  236. *     except that all lower case letters are converted to upper case.   *
  237. *                                                                       *
  238. ************************************************************************)
  239.  
  240. function AllCaps (CapsStr : String) : String;
  241.  
  242.  
  243. (*************************************************************************
  244. *                                                                        *
  245. *                               LASTSPACE                                *
  246. *                                                                        *
  247. *     This procedure searches the 'Line' passed, backward, starting at   *
  248. *     'SpacePos', for a space, comma, slash or hyphen.  The position of  *
  249. *     the space character in the string is returned in 'SpacePos'.       *
  250. *                                                                        *
  251. *************************************************************************)
  252.  
  253. procedure LastSpace (    Line     : String;
  254.                      var SpacePos : byte);
  255.  
  256.  
  257. (*************************************************************************
  258. *                                                                        *
  259. *                               HELP                                     *
  260. *                                                                        *
  261. *     This procedure creates a bordered window of 5 lines on the top     *
  262. *     half of the screen if the current cursor location is in the bottom *
  263. *     half, or vice-versa, then opens the file specified by HelpFileName *
  264. *     in the current directory, reads a linked list of text records on   *
  265. *     to the heap, and then displays them in the help window.  if more   *
  266. *     than 5 lines of help are available, the user can scoll or page     *
  267. *     the window, or use Home or End to go to the beginning or end of    *
  268. *     the help screen.  RETurn or ESCape will restore the prior screen   *
  269. *     and in addition ESCape will set the variable Escape to true.  If   *
  270. *     'HelpNum' is zero, the routine will return with no response.       *
  271. *                                                                        *
  272. *************************************************************************)
  273.  
  274. procedure Help (HelpNum : word);
  275.  
  276.  
  277. (*************************************************************************
  278. *                                                                        *
  279. *                                MESSAGE                                 *
  280. *                                                                        *
  281. *     This procedure prints the text passed on the bottom line of the    *
  282. *     currently active window.  If 'Error' is true, 'ErrMsg' is set to   *
  283. *     treu, and if 'BeepOnError' is true it also beeps.                  *
  284. *                                                                        *
  285. *************************************************************************)
  286.  
  287. procedure Message (Error : boolean;
  288.                     text : string80);
  289.  
  290.  
  291. (************************************************************************
  292. *                                                                       *
  293. *                               SHOWYESNO                               *
  294. *                                                                       *
  295. *     This procedure writes 'Yes' or 'No' on the screen at position     *
  296. *     (x,y) depending on whether the default passed is true or false.   *
  297. *     If 'flen' (field length) is less than 3, 'Y' or 'N' will be       *
  298. *     displayed.                                                        *
  299. *                                                                       *
  300. ************************************************************************)
  301.  
  302. procedure ShowYesNo (x, y, flen : byte;
  303.                      default    : boolean);
  304.  
  305.  
  306. (*************************************************************************
  307. *                                                                        *
  308. *                               DISPSTRING                               *
  309. *                                                                        *
  310. *     This procdure goes to position 'x', 'y' on the screen and dis-     *
  311. *     plays 'OutStr' in a field which is 'FldLnth' characters wide.      *
  312. *     All unused parts of the field are cleared.  If 'RightJust' is      *
  313. *     true 'OutStr' is right justified in the field.                     *
  314. *                                                                        *
  315. *************************************************************************)
  316.  
  317. procedure DispString (x, y,
  318.                       FldLnth   : byte;
  319.                       RightJust : boolean;
  320.                       OutStr    : string80);
  321.  
  322.  
  323. (************************************************************************
  324. *                                                                       *
  325. *                            DISPLAYWORDS                               *
  326. *                                                                       *
  327. *     This procedure displays a list of words from a linked list on     *
  328. *     the heap, on a single line beginning at 'X', 'Y'.  If there are   *
  329. *     more words in the list than can be displayed on a single line,    *
  330. *     the procedure will display all possible and then print '[MORE]'.  *
  331. *     If the space character is included in 'ExtraChars' then each      *
  332. *     word (or phrase) will be separated by a comma and a space,        *
  333. *     otherwise they will be separated only by a space.                 *
  334. *                                                                       *
  335. ************************************************************************)
  336.  
  337. procedure DisplayWords (WordPtr : wordpointer;
  338.                         X, Y : integer;
  339.                         ExtraChars : setofchar);
  340.  
  341.  
  342. (*************************************************************************
  343. *                                                                        *
  344. *                               ADDCOMMAS                                *
  345. *                                                                        *
  346. *     This procedure takes the string passed, 'NumStr', which should     *
  347. *     consist only of numerals, a decimal point, and a leading '+' or    *
  348. *     '-' and adds a comma every three characters in front of the right- *
  349. *     most decimal point.                                                *
  350. *                                                                        *
  351. *************************************************************************)
  352.  
  353. procedure AddCommas (var NumStr : string30);
  354.  
  355.  
  356. (*************************************************************************
  357. *                                                                        *
  358. *                               DISPREAL                                 *
  359. *                                                                        *
  360. *     This procedure displays a real number at position 'X', 'Y' in a    *
  361. *     field which is 'FldLnth' characters wide.  Zeros are added or      *
  362. *     the number is truncated, as needed, to display 'Decimals' number   *
  363. *     of digits past the decimal point.  Commas are added as needed.     *
  364. *     If RightJust is true, the number is right-justified in the field.  *
  365. *                                                                        *
  366. *************************************************************************)
  367.  
  368. procedure DispReal (x, y,
  369.                     FldLnth,
  370.                     Decimals  : byte;
  371.                     RightJust : boolean;
  372.                     OutReal   : real);
  373.  
  374.  
  375. (*************************************************************************
  376. *                                                                        *
  377. *                              DISPINTEGER                               *
  378. *                                                                        *
  379. *     This procedure displays any integer number at position 'X', 'Y'    *
  380. *     in a field which is 'FldLnth' characters wide.  Commas are added   *
  381. *     as needed.  If RightJust is true, the number is right-justified    *
  382. *     in the field.                                                      *
  383. *                                                                        *
  384. *************************************************************************)
  385.  
  386. procedure DispInteger (x, y,
  387.                        FldLnth   : byte;
  388.                        RightJust : boolean;
  389.                        OutInt    : longint);
  390.  
  391.  
  392. (*************************************************************************
  393. *                                                                        *
  394. *                             DATETOSTR                                  *
  395. *                                                                        *
  396. *     This function returns a date string from a variable of type        *
  397. *     'datetype' according to a requested format.  Format '0' is         *
  398. *     MM/DD/YYYY, format '1' is DD MON YYYY, and Format '2' is           *
  399. *     Month DD, YYYY.                                                    *
  400. *                                                                        *
  401. *************************************************************************)
  402.  
  403. function DateToStr (DateStr : datetype;
  404.                     format  : byte) : string20;
  405.  
  406.  
  407. (*************************************************************************
  408. *                                                                        *
  409. *                             MAKEFRACTION                               *
  410. *                                                                        *
  411. *     This function converts a the decimal part of a real number to a    *
  412. *     fraction, e.g. if the decimal portion is .25, .33, .50., .67, or   *
  413. *     .75 (as well as some others) the string returned will be a space   *
  414. *     and then 1/4, 1/3, 1/2, etc. as appropriate.  If the number        *
  415. *     cannot be converted to a fraction the decimal part will be return  *
  416. *     as a decimal point followed by a two digit string.  The function   *
  417. *     will convert everything within two one-hundredths of the target.   *
  418. *                                                                        *
  419. *************************************************************************)
  420.  
  421. function MakeFraction (IOReal : real) : String5;
  422.  
  423.  
  424. (************************************************************************
  425. *                                                                       *
  426. *                               GETCHAR                                 *
  427. *                                                                       *
  428. *     This function repeatedly reads a character from the keyboard,     *
  429. *     until the character is in the set of acceptable characters.       *
  430. *     ESCape is always acceptable.  If the pre-defined help key is      *
  431. *     pressed, the appropriate help message is displayed.  When a       *
  432. *     valid key is pressed, it is returned.                             *
  433. *                                                                       *
  434. ************************************************************************)
  435.  
  436. function GetChar ( OKSet   : setofchar;
  437.                    HelpNum : word)       : char;
  438.  
  439.  
  440. (************************************************************************
  441. *                                                                       *
  442. *                               GETYESNO                                *
  443. *                                                                       *
  444. *     This procedure goes to position 'x', 'y' on the screen and waits  *
  445. *     for a keyboard response of Y, N, or Ret.  It returns true for     *
  446. *     yes, or false for no.  If a Return or Escape is pressed it        *
  447. *     returns the value of the default.  The input is displayed by      *
  448. *     ShowYesNo, so a field length must be passed.                       *
  449. *                                                                       *
  450. ************************************************************************)
  451.  
  452. function GetYesNo (x, y, flen : byte;
  453.                    HelpNum    : word;
  454.                    default    : boolean) : boolean;
  455.  
  456.  
  457. (************************************************************************
  458. *                                                                       *
  459. *                               CORRECT                                 *
  460. *                                                                       *
  461. *     This function goes to position (x,y) on the screen and asks if    *
  462. *     the above is correct.  If the response is yes, the function       *
  463. *     returns true, otherwise it returns false.                         *
  464. *                                                                       *
  465. ************************************************************************)
  466.  
  467. function Correct (x, y, flen : byte;
  468.                   HelpNum    : word;
  469.                   default    : boolean) : boolean;
  470.  
  471.  
  472. (************************************************************************
  473. *                                                                       *
  474. *                               EDITLINE                                *
  475. *                                                                       *
  476. *     This procedure allows editing of the 'Line' passed.  The routine  *
  477. *     will first write the line at 'X', 'Y', clearing the remainder     *
  478. *     of the field.  Only those characters included in OKSet will be    *
  479. *     accepted.  The routine will end upon receipt of any character     *
  480. *     included in ExitSet or by pressing ESCape or RETurn, or when the  *
  481. *     cursor position in the line exceeds the field length.  Pressing   *
  482. *     the Help key (usually F1, but can be changed) will display the    *
  483. *     help screen specified by 'HelpNum.'  'Cursor' contains the        *
  484. *     position of the cursor in the field, and can be used to start     *
  485. *     the editing at greater than position 1.  If Upper is true, each   *
  486. *     character entered will be forced to upper case.  If FieldIn is    *
  487. *     true, the procedure will not terminate when the 'Line' length     *
  488. *     becomes longer than the specified 'FldLnth', rather, 'Line' will  *
  489. *     be truncated to fit.  In addition, pressing Ctrl-left arrow,      *
  490. *     Ctrl-right arrow, Ctrl-A or Ctrl-F will terminate the procedure.  *
  491. *     If FieldIn is false, these actions will not be taken, and in      *
  492. *     addition, the row and cursor numbers, and insert status will be   *
  493. *     displayed on the last line of the screen.  The tab key (or ^I)    *
  494. *     will move the cursor to the next multiple of 5, and if 'InsertOn' *
  495. *     is true, spaces will be added.  Key will return the control       *
  496. *     character which caused the routine to terminate, or #1F if the    *
  497. *     cursor moved past the end of the field.                           *
  498. *                                                                       *
  499. ************************************************************************)
  500.  
  501. procedure EditLine (var Line    : String90;
  502.                         X, Y,
  503.                         FldLnth : byte;
  504.                         OKSet,
  505.                         ExitSet : setofchar;
  506.                         HelpNum : word;
  507.                     var Cursor  : byte;
  508.                         UpperC,
  509.                         FieldIn : Boolean;
  510.                     var control : char);
  511.  
  512.  
  513. (*************************************************************************
  514. *                                                                        *
  515. *                             SELECTFIELD                                *
  516. *                                                                        *
  517. *     Calling this procedure will mark the field starting at 'X', 'Y'    *
  518. *     and having length 'FldLnth' with the characters stored in          *
  519. *     'StartField' and 'EndField', or, if StartField is in the range     *
  520. *     0 .. 8, will set the BackGround color to ORD (StartField), and     *
  521. *     the foreground color to ORD (EndField).  The field will be cleared *
  522. *     and set to the background color.  Note that if characters are used *
  523. *     to mark the field, they will be placed at X - 1 and X + FldLnth +  *
  524. *     1, so X must never be less than 2 and X + FldLnth must not be      *
  525. *     allowed to exceed the screen width. If MarkField is false, the     *
  526. *     field will be cleared, but not marked.                             *
  527. *                                                                        *
  528. *************************************************************************)
  529.  
  530. procedure SelectField (x, y,
  531.                        FldLnth   : byte;
  532.                        MarkField : boolean);
  533.  
  534.  
  535. (*************************************************************************
  536. *                                                                        *
  537. *                            DESELECTFIELD                               *
  538. *                                                                        *
  539. *     This procedure will remove the markings left at 'X', 'Y' by        *
  540. *     'SelectField', and restore the prior background color.  If the     *
  541. *     field was marked by SelectField, be sure that MarkField is true.   *
  542. *                                                                        *
  543. *************************************************************************)
  544.  
  545. procedure DeselectField (x, y,
  546.                          fldlnth   : byte;
  547.                          MarkField : boolean);
  548.  
  549.  
  550. (*************************************************************************
  551. *                                                                        *
  552. *                              GETFIELD                                  *
  553. *                                                                        *
  554. *     This function will return a string input into a field at 'X', 'Y'. *
  555. *     'FldLnth' is the length of the field, 'MinLnth' is the minimum     *
  556. *     acceptable length for the input, 'StrtPos' is the starting posi-   *
  557. *     tion for the cursor, and 'HelpNum' is the number of the help       *
  558. *     screen associated with this field.  If 'UpperCase' is true all     *
  559. *     input will be forced to upper case, and if 'RightJust' is true     *
  560. *     the input will be right justified in the field when the function   *
  561. *     returns.  'OKSet' contains the characters which are acceptable as  *
  562. *     input and 'MarkField' is true if you want the field marked.        *
  563. *     'Contents' contains the string to be edited, if any, and 'Key'     *
  564. *     returns the control key which terminated the function; these       *
  565. *     keys are Up, Down, Right, Left, PgUp, PgDn, Home, EndKey, WdRt,    *
  566. *     WdLt, Ret and Esc (see the type declaration for control-key        *
  567. *     equivilencies).                                                    *
  568. *                                                                        *
  569. *************************************************************************)
  570.  
  571. function GetField  (    x, y,
  572.                         FldLnth,
  573.                         MinLnth,
  574.                         StrtPos    : byte;
  575.                         HelpNum    : word;
  576.                         UpperCase,
  577.                         RightJust  : boolean;
  578.                         OKSet      : setofchar;
  579.                         MarkField  : boolean;
  580.                         Contents   : string;
  581.                     var control    : char)       : String;
  582.  
  583.  
  584. (*************************************************************************
  585. *                                                                        *
  586. *                              GETLIST                                   *
  587. *                                                                        *
  588. *     This routine gets or edits a words on a single line, which are     *
  589. *     contained on a linked list on the heap.  Each word is marked as    *
  590. *     it is edited, and cannot exceed 25 characters.  Only those         *
  591. *     characters contained in NameChars and ExtraChars are acceptable    *
  592. *     input.  A comma or a space will end a word, as well as RETurn or   *
  593. *     ESCape, so long as either is NOT in ExtraChars.                    *
  594. *                                                                        *
  595. *************************************************************************)
  596.  
  597. procedure GetList (    x, y,
  598.                        WordLen    : byte;
  599.                        HelpNum    : word;
  600.                        UpperCase  : boolean;
  601.                        ExtraChars : setofchar;
  602.                    var WordPtr    : wordpointer;
  603.                    var control    : char);
  604.  
  605.  
  606. (*************************************************************************
  607. *                                                                        *
  608. *                               GETREAL                                  *
  609. *                                                                        *
  610. *     This function inputs a real number in a manner similar to that of  *
  611. *     'GetField.'  'Min' and 'Max' are the minimum and maximum accep-    *
  612. *     table values for this field, and 'Decimals' is the number of       *
  613. *     decimal places accepted.  IOReal is the beginning value.           *
  614. *                                                                        *
  615. *************************************************************************)
  616.  
  617. function GetReal (    X, Y,
  618.                       FldLnth   : byte;
  619.                       HelpNum   : word;
  620.                       Min, Max  : real;
  621.                       Decimals  : byte;
  622.                       RightJust,
  623.                       MarkField : boolean;
  624.                       IOReal    : real;
  625.                   var Control   : char)    : real;
  626.  
  627.  
  628. (*************************************************************************
  629. *                                                                        *
  630. *                            GETINTEGER                                  *
  631. *                                                                        *
  632. *     This function inputs any integer number in a manner similar to     *
  633. *     that of 'GetField.'  'Min' and 'Max' are the minimum and maximum   *
  634. *     acceptable values for this field.  IOInteger is the beginning      *
  635. *     value for the field.                                               *
  636. *                                                                        *
  637. *************************************************************************)
  638.  
  639. function GetInteger (    X, Y,
  640.                          FldLnth   : byte;
  641.                          Help      : word;
  642.                          Min, Max  : longint;
  643.                          RightJust,
  644.                          MarkField : boolean;
  645.                          IOInteger : longint;
  646.                      var Control   : char)   : longint;
  647.  
  648.  
  649. (*************************************************************************
  650. *                                                                        *
  651. *                           GETDATESTR                                   *
  652. *                                                                        *
  653. *     This function reads a date string in almost any format and con-    *
  654. *     verts to a value of type 'datetype.'  'Format' specifies how the   *
  655. *     date will be displayed when the function ends.  If 'Precise' is    *
  656. *     true, approximate dates (dates containing question marks) will     *
  657. *     not be allowed, and if 'NoFuture' is true, dates beyond            *
  658. *'    'TodaysDate' will not be allowed.  'DateStr' passes the default.   *
  659. *                                                                        *
  660. *************************************************************************)
  661.  
  662. function GetDateStr (    X, Y,
  663.                          FldLnth,
  664.                          format  : byte;
  665.                          helpNum : word;
  666.                          precise : boolean;
  667.                          Markfield : boolean;
  668.                          DateStr : datetype;
  669.                      var Control  :  char)     : datetype;
  670.  
  671.  
  672. (*************************************************************************
  673. *                                                                        *
  674. *                             GETFRACTION                                *
  675. *                                                                        *
  676. *     This function gets a string of numbers, which may contain a        *
  677. *     fraction, and converts it to a real number.  IOReal passes the     *
  678. *     default, which is converted to a string containing a fraction for  *
  679. *     input, if possible.                                                *
  680. *                                                                        *
  681. *************************************************************************)
  682.  
  683. function GetFraction (    X, Y      : byte;
  684.                           HelpNum   : word;
  685.                           RightJust,
  686.                           MarkField : boolean;
  687.                           IOReal    :  real;
  688.                       var Control  :  char)   : real;
  689.  
  690.  
  691. (*************************************************************************
  692. *                                                                        *
  693. *                              MENUOPTION                                *
  694. *                                                                        *
  695. *     This function goes to 'X', 'Y' and prints:                         *
  696. *                                                                        *
  697. *          'Enter your selection > <, or press ESC to exit.'             *
  698. *                                                                        *
  699. *     It then waits for the user to enter one of the characters included *
  700. *     in 'Options', which is converted to upper case and returned, or    *
  701. *     ESCape if that key was pressed in response.                        *
  702. *                                                                        *
  703. *************************************************************************)
  704.  
  705. function MenuOption (x, y    : byte;
  706.                      HelpNum : word;
  707.                      Options : setofchar ) : char;
  708.  
  709.  
  710.  
  711. {    FieldIO is shareware, which  means that it, like most shareware, may
  712. be freely copied and distributed so long  as no consideration is required
  713. for its distribution,  except a  copying and  media charge  not to exceed
  714. $3.00, including the cost  of the means of distribution (i.e., diskette).
  715. Users who find the  program of  value to  them should  consider sending a
  716. donation to Pass-Key Software.
  717.  
  718.      Users  sending a  donation of  $25.00 or  more are  registered, will
  719. receive notification  of upgrades and  modifications to this product, and
  720. are entitled to receive source code and future updates, upon request, for
  721. the cost of a diskette and postage.   Non-registered users may not incor-
  722. porate this unit  into any  commercially distributed  software, including
  723. shareware, while registered users may do so freely.
  724.  
  725.      FieldIO is a  copyrighted program,  and is  protected by the laws of
  726. the United States  and each  of its  several states,  as well as interna-
  727. tional treaties  and conventions.   A licence  is hereby  granted to  all
  728. persons to use this program  according to the terms and restrictions con-
  729. tained herein.  All  programs which  incorporate all  or any part of this
  730. program must include the following  phrase both in the source code and in
  731. any accompanying documentation:
  732.  
  733.      Portions of this program Copyright (c) 1988 by W. Lee Passey.
  734.      This program is distributed as is, and by its use each person agrees
  735. to the terms and conditions of this license, and acknowledges that W. Lee
  736. Passey and Pass-Key  Software have made no  warranties, either express or
  737. implied, concerning the  performance of this software,  including warran-
  738. ties of merchantability or fitness for a particular purpose.
  739.  
  740.      Please send all  comments,  suggestions,  information regarding pos-
  741. sible bugs, donations and registration information to:
  742.  
  743.                             Pass-Key Software
  744.                             119 MacArthur Ave.
  745.                          Salt Lake City, UT  84115or use  your  modem  to call  The  Motherboard,  (801) 485-7211,  8 data,
  746. 1 stop, no parity,  300/1200/2400 baud, 24 hours/day, 7 days/week (except
  747. when I'm using the computer).
  748.      I am also looking for a  job in the  data processing field, and this
  749. unit is a good example  of my  programming skills.   If any employers are
  750. interested in using me as an employee, please contact me in the same way.
  751.  
  752. }
  753.