home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ATSAY5.ZIP / ATSAYGET.DOC next >
Encoding:
Text File  |  1993-01-04  |  6.4 KB  |  149 lines

  1. ATSAYGET.DOC for Version 4.1 of ATSAYGET.PAS unit:
  2.  
  3.     The AtSayGet.TPU is a unit of procedures that allows positioning
  4. of data entry prompts and screened data entry. A full range of editing
  5. keys are also employed. These features give the functional equivalence 
  6. of the dBase: @ Line,Row SAY 'prompt' GET <variable> [PICTURE 'template']
  7. command. The unit interface follows:
  8.  
  9. UNIT ATSAYGET;
  10. TYPE
  11.  Xrange=1..79;
  12.  Yrange=1..25;
  13.  FieldTxt=STRING[80];
  14.  
  15. (* BOOLEAN PROCEDURE *)
  16. PROCEDURE AtSayGetBoolean(X     :Xrange;
  17.                           Y     :Yrange;
  18.                           Prompt:FieldTxt; {text of prompt}
  19.               VAR TorF  :BOOLEAN); {boolean variable}
  20.  
  21. (* STRING PROCEDURES *)
  22. PROCEDURE AtSayGetStrLen(X     :Xrange;
  23.                          Y     :Yrange;
  24.                          Prompt:FieldTxt; {text of prompt}
  25.              VAR InStr :FieldTxt; {string variable being entered}
  26.              FldLen:BYTE);    {allowed field length of entry}
  27.  
  28. PROCEDURE AtSayGetStrPic(X     :Xrange;
  29.                          Y     :Yrange;
  30.                          Prompt:FieldTxt;  {text of prompt}
  31.              VAR InStr :FieldTxt;  {string variable being entered}
  32.              Pic   :FieldTxt); {picture template
  33.                         TempletSet=['!','9','A','X'];
  34.                         ! forces uppercase
  35.                         9 allows only numeric entry
  36.                         A allows only alpha entry
  37.                         X allows any entry}
  38. (* NUMERIC PROCEDURES *)
  39. PROCEDURE AtSayGetReal(X     :Xrange;
  40.                        Y     :Yrange;
  41.                        Prompt:FieldTxt; {text of prompt}
  42.                    VAR InNum :REAL  ;   {numeric variable being entered}
  43.                        FldLen,          {allowed field length of entry}
  44.                        DecPl :INTEGER); {decimal places}
  45.  
  46. PROCEDURE AtSayGetLongInt(X     :Xrange;
  47.                           Y     :Yrange;
  48.                           Prompt:FieldTxt; {text of prompt}
  49.               VAR InNum :LONGINT;  {numeric variable being entered}
  50.               FldLen:INTEGER); {allowed field length of entry}
  51.  
  52. PROCEDURE AtSayGetInt(X     :Xrange;
  53.                       Y     :Yrange;
  54.                       Prompt:FieldTxt; {text of prompt}
  55.           VAR InNum :INTEGER;  {numeric variable being entered}
  56.               FldLen:INTEGER); {allowed field length of entry}
  57.  
  58. (* NUMERIC PROCEDURES - Cont. *)
  59. PROCEDURE AtSayGetWord(X     :Xrange;
  60.                        Y     :Yrange;
  61.                        Prompt:FieldTxt; {text of prompt}
  62.            VAR InNum :WORD;     {numeric variable being entered}
  63.                FldLen:INTEGER); {allowed field length of entry}
  64.  
  65.  
  66.  
  67. EDITING KEYS
  68.  
  69. When you are positioned in a data field certain keys and combinations
  70. of keys will facilitate editing. If you are familiar with dBase or WordStar
  71. you will find that the editing keys noted below are very similar. 
  72.  
  73. Key(s)         Function
  74. -------------- --------------------------------------------------
  75. <-        
  76. Ctrl S . . . . Move cursor one character to the left.
  77. ->
  78. Ctrl D . . . . Move cursor one character to the right.
  79. Ctrl <-
  80. Ctrl A . . . . Move cursor one word to the left.
  81. Ctrl ->
  82. Ctrl F . . . . Move cursor one word to the right.
  83. Home
  84. Ctrl Z . . . . Move to the start of the field.
  85. End
  86. Ctrl B . . . . Move to the last character in the field.
  87. Del
  88. Ctrl G . . . . Delete the character at the cursor position and
  89.                pull over all the characters on the right.
  90. Ctrl T . . . . Delete word to right and pull over remaining text.
  91. Ctrl Y . . . . Delete the whole field.
  92. Ctrl R . . . . Restore field to its original state before edit.
  93. BackSpace  . . Delete the character to the left of the cursor and
  94.                pull over all the characters on the right.
  95. Ins
  96. Ctrl V . . . . Toggles insert on/off.
  97. SpaceBar . . . Move cursor to the right. If insert is off it will
  98.                over-write any characters, otherwise it will push them
  99.                to the right as it moves.
  100.  
  101.  
  102.             SPECIAL CONSIDERATIONS:
  103.  
  104. Compiler Settings:
  105.      Programs using AtSayGet.TPU must be compiled with the Options/Compiler/
  106. Var-string checking as RELAXED, or include the {$V-} compiler directive.
  107.  
  108. Initialization of variables:
  109.      All formal variable parameters passed to one of the AtSayGet pro-
  110. cedures should first be properly initialized as the current value of the
  111. variable will be displayed in the data field. For example, if you are using 
  112. the AtSayGetStrLen procedure to enter a new STRING[10] variable without first 
  113. properly initializing the variable with an actual or nul value, 10 "random"
  114. charactors will be displayed in the entry field until a ^Y is issued or the 
  115. field is filled with data by the operator.
  116.      Special care must taken with variables passed to the AtSayGetStrPic 
  117. procedure to initialize the formal variable with the exact length of spaces
  118. or text equal to SizeOf(InStr).
  119.      When using an AtSayGet procedure to enter numeric data you will also wish
  120. to initialize the variable. All numerals in the entry field, even if they are
  121. seperated with spaces, will compose the value passed by the procedure. Thus,
  122. in a field the length of 4 the entry [12 0] will be returned as [ 120]. This
  123. is different than the way dBase accepts numeric input (which, in this example,
  124. would return [  12]) and can be modified in the unit source code if desired.
  125.  
  126. Screen limits:
  127.      Note that the maximum X-coordinate is 80 and the maximum Y-coordinate is
  128. 25. Nevertheless, these procedures will not wrap on the screen, but rather will
  129. just exit without doing anything if (X+Length(Prompt)+[field length]+1) > 80.
  130.  
  131. Range checking:
  132.      Numeric range checking routines are incorporated within the AtSayGet
  133. procedures. Thus, if the operator enters a negative number in a AtSayGetWord
  134. field the bell will ring and the message ERROR will be briefly displayed. The
  135. RANGE and VALID clauses of dBase are not emulated but this is a simple coding
  136. task that any Pascal programmer can handle.
  137.  
  138. Demonstration of procedures:
  139.      Compile and run ASG_DEMO.PAS to see how the procedures in this unit can
  140. be used. When looking at the code notice how the variables are initialized.
  141.  
  142. *  *  *  *  *  *  *  *  * *  *  *  *  *  *  *  *  * *  *  *  *  *  *  *
  143.  
  144. This Turbo Pascal unit was compiled with the version 4.0 compiler, and was
  145. coded by John Roncalio, BlueRibbon Software, 34439 Ascott Avenue, Abbotsford,
  146. B.C., CANADA, V2S 4V6. CIS: [72377,1657]
  147.  
  148. Source code for this unit and the BlueBag unit are available on disk for the
  149. small charge of $8.50 (U.S.) or $10.oo (Canadian). Order by writing to the copyright holder noted above.