home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OPNOS2.ZIP / KLTLIE.ARS < prev    next >
Text File  |  1993-02-22  |  40KB  |  251 lines

  1. 1Data Entry                Main            regular  read/write                                                                                      
  2. 31SG      read/writeyes                                                                                                                             
  3. 4DelMsg  Delete the record                                                                                                                          
  4. 4Exist   Record exist                                                                                                                               
  5. 4Exit    Quit                                                                                                                                       
  6. 4First   First record                                                                                                                               
  7. 4Last    Last record                                                                                                                                
  8. 4NoCur   No current record to delete/update                                                                                                         
  9. 4WriteErrFile Access Error                                                                                                                          
  10. 5Date0   Date 0         Date   American 10  100/00/0000;                                                                                            
  11. 5Zero    zero           Long   Positive1  1  0;                                                                                                     
  12. 5One     One            Long   Positive1  1  1;                                                                                                     
  13. 5Two     two            Long   Positive 1 1  2;                                                                                                     
  14. 5Title   title          Char   Lf-T-Rgh20 1  Data entry;                                                                                            
  15. 5BLANK   blank          Char   Lf-T-Rgh1  1   ;                                                                                                    .
  16. 5Dummy   dummy          Char   Lf-T-Rgh10 1  1;                                                                                                    .
  17. 5MaxReal MaxReal        Float  1        10  19999999999;                                                                                            
  18. 5MaxLong MaxLong        Long   Positive 10  12147480000;                                                                                            
  19. 5MaxInt  MaxInt         IntegerPositive  5  132767;                                                                                                 
  20. 5MaxStr  MaxStr         Char   Lf-T-Rgh 20  1zzzzzzzzzzzzzzzzzzzz;                                                                                  
  21. 5MaxDate MaxDate        Date   American 10  112/31/9999;                                                                                            
  22. 5MaxTime MaxTime        Time   Time      8  123:59:59;                                                                                              
  23. 5MaxByte MaxByte        Byte   Positive  4  1127;                                                                                                   
  24. 5OK                     IntegerPositive  1  10;                                                                                                     
  25. 5OKtitle                Char   Lf-T-Rgh  4  1O.K.;                                                                                                  
  26. 5Cancel                 IntegerPositive  1  10;                                                                                                     
  27. 5CancelT                Char   Lf-T-Rgh  8  1Esc=Quit;                                                                                              
  28. 5Next                   Char   Lf-T-Rgh  4  1Next;                                                                                                  
  29. 5First                  Char   Lf-T-Rgh  4  1Top;                                                                                                   
  30. 5Last                   Char   Lf-T-Rgh  4  1Last;                                                                                                  
  31. 5Prev                   Char   Lf-T-Rgh  4  1Prev;                                                                                                  
  32. 5Add                    Char   Lf-T-Rgh  4  1Add;                                                                                                   
  33. 5Upd                    Char   Lf-T-Rgh  4  1Upd;                                                                                                   
  34. 5Del                    Char   Lf-T-Rgh  4  1Del;                                                                                                   
  35. 5Locate                 Char   Lf-T-Rgh  4  1Find;                                                                                                  
  36. 5Quit                   Char   Lf-T-Rgh  4  1Quit;                                                                                                  
  37. 5Action  Action         Char   Lf-T-Rgh  4  1Add;                                                                                                   
  38. 5ActLst  ActLst         Char   Lf-T-Rgh  4  9Add;Upd;Del;Next;Prev;Top;Last;Find;Quit;                                                              
  39. 5Menu    Menu           Char   Lf-T-Rgh 20  1Menu;                                                                                                  
  40. 5RepeatB                Long   Positive  1  10;                                                                                                       5RepeatT                Char   Lf-T-Rgh  7  1Repeat;                                                                                                  6Menu      0.667 -0.053 18.667 13.895L_FRAME         PINK            0Menu    DEFAULT_WINDOW  Nobmp   1      1      12     6                          6MAIN     19.333  3.000 74.000 10.895L_FRAME         DARKGRAY        0Title   DEFAULT_WINDOW  Data    0.5    0.5    6      8                          7MAIN    1Key1    0Dummy    57.167  5.737  7.500  1.000S_ARISTO        BACKGROUND      BLUE            KEY              NONE                          7MAIN    0RepeatB 0RepeatT   2.000  2.000 20.000  1.000S_BUTTON        GREEN           RED             Repeat           NONE                          7Menu    0Action  0ActLst    0.667  0.053 16.000 12.053S_RADIOV        GREEN           BLUE            Action           ON_TOP   10.895               9Main          Z0=New-Scr                  0Title                                                                                                   
  41. 9                 Setoff                            Q5                                                                                              
  42. 9                 Put-Lin#MAIN             0Zero                                                                                                    
  43. 9                 Put-Lin#Menu             0Zero                                                                                                    
  44. 9##########The following lines find and display the first record.                                                                                   
  45. 9                 Perform                              First                                                                                        
  46. 9                 Perform                              Next                                                                                         
  47. 9                 Perform                              Display                                                                                      
  48. 9##########In the following loop the user is asked to select an action. This loop will continue as long as                                          
  49. 9##########the Q5 flag is OFF.                                                                                                                      
  50. 9Loop                                                                                                                                               
  51. 9                 While   NotQuit                                                                                                                   
  52. 9##########The following  Accept command is executed to access the user selection.                                                                  
  53. 9##########When a selection is made, the Dialog ends and a "Switch" begins to execute the selection.                                                
  54. 9ActDlg                                                                                                                                             
  55. 9                 Dialog +0                                                                                                                           9                 Accept *Action                    Q5                                                                                              
  56. 9                 Goto                                 DlgEnd                                                                                         9                 Accept *Repeat                    Q5                                                                                              
  57. 9                 Goto                                 DlgEnd                                                                                         9DlgEnd           E-Dialg                                                                                                                             9              Q5 Moves  0Quit             0Action                                                                                                  
  58. 9##########The following switch contains cases for each selection made by the user.                                                                 
  59. 9                 Switch 0Action                                                                                                                    
  60. 9                 Case   0First                                                                                                                     
  61. 9                 Perform                              First                                                                                        
  62. 9                 Perform                              Next                                                                                         
  63. 9                 Perform                              Display                                                                                      
  64. 9                 QtSwtch                                                                                                                           
  65. 9                 Case   0Last                                                                                                                      
  66. 9                 Perform                              Last                                                                                         
  67. 9                 Perform                              Prev                                                                                         
  68. 9                 Perform                              Display                                                                                      
  69. 9                 QtSwtch                                                                                                                           
  70. 9                 Case   0Next                                                                                                                      
  71. 9                 Perform                              Next                                                                                         
  72. 9                 Perform                              Display                                                                                      
  73. 9                 QtSwtch                                                                                                                           
  74. 9                 Case   0Prev                                                                                                                      
  75. 9                 Perform                              Prev                                                                                         
  76. 9                 Perform                              Display                                                                                      
  77. 9                 QtSwtch                                                                                                                           
  78. 9                 Case   0Add                                                                                                                       
  79. 9##########When Add is selected, an Add loop begins calling the Insert routine as long as the flag I1 is                                            
  80. 9##########OFF.                                                                                                                                       9                 Setoff                            I1                                                                                              
  81. 9                 While   AddLoop                                                                                                                   
  82. 9                 Perform                              Insert                                                                                       
  83. 9                 EndBlck                                                                                                                           
  84. 9                 Perform                              FindCur                                                                                      
  85. 9                 QtSwtch                                                                                                                           
  86. 9                 Case   0Upd                                                                                                                       
  87. 9##########When Upd is selected, an Update loop begins calling the Update routine and reading the next                                              
  88. 9##########record as long as there are records to read and the user does not abort the updating process.                                            
  89. 9                 Setoff                            U1                                                                                              
  90. 9                 While   UpdLoop                                                                                                                   
  91. 9                 Perform                              Update                                                                                       
  92. 9              U1 QtLoop                                                                                                                            
  93. 9                 Read   1KEY1                      I0                                                                                              
  94. 9                 Perform                              I/O_ok                                                                                       
  95. 9              I0 Seton                             U1                                                                                              
  96. 9                 EndBlck                                                                                                                           
  97. 9                 Perform                              FindCur                                                                                      
  98. 9                 QtSwtch                                                                                                                           
  99. 9                 Case   0Del                                                                                                                       
  100. 9                 Perform                              Delete                                                                                       
  101. 9                 QtSwtch                                                                                                                           
  102. 9                 Case   0Locate                                                                                                                    
  103. 9                 Perform                              Locate                                                                                       
  104. 9                 QtSwtch                                                                                                                           
  105. 9                 Case   0Quit                                                                                                                      
  106. 9                 Seton                             Q5                                                                                              
  107. 9                 QtSwtch                                                                                                                           
  108. 9                 EndSwch                                                                                                                           
  109. 9                 EndBlck                                                                                                                           
  110. 9LoopEnd                                                                                                                                            
  111. 9##########             -------- Main loop end  -----------                                                                                         
  112. 9                 Clr-Lin#MAIN                                                                                                                      
  113. 9                 Clr-Lin#Menu                                                                                                                      
  114. 9                 Return                                                                                                                            
  115. 9##########The following Insert routine is executed when the Add operation is selected.                                                             
  116. 9Insert                                                                                                                                             
  117. 9                 Setoff                            I1                                                                                              
  118. 9                 Perform                              First                                                                                        
  119. 9##########The "First" routine is used here to initiate fields and clear them of previous values.                                                   
  120. 9                 Perform                              Disp*                                                                                        
  121. 9Ins1             Perform                              AccKey                                                                                       
  122. 9##########The key fields data are entered by the user in the "AccKey" routine. If the user aborts the                                              
  123. 9##########data entry, the flag A1 is set to ON and the Insert routine is aborted.                                                                  
  124. 9              A1 Seton                             I1 InsEnd                                                                                       
  125. 9                 Find   1KEY1                      I0                                                                                              
  126. 9                 Perform                              I/O_ok                                                                                       
  127. 9##########A Find command is executed to an existing record with the entered key field value.                                                       
  128. 9              I0=Message!Exist   +1       +1                                                                                                       
  129. 9              I0=Goto                                 Ins1                                                                                         
  130. 9                 Perform                              AccData                                                                                      
  131. 9##########The data fields data are entered by the user in the "AccData" routine. If the user aborts the                                            
  132. 9##########data entry, the flag A2 is set to ON and the flow is diverted to the "Ins1"  label.                                                      
  133. 9              A2 Goto                                 Ins1                                                                                         
  134. 9                 Write  1                          I0                                                                                              
  135. 9                 Perform                              I/O_ok                                                                                       
  136. 9##########"Write"  is  executed  to write the record.                                                                                              
  137. 9InsEnd           Return                                                                                                                            
  138. 9##########          ----- Insert routine end ---------                                                                                             
  139. 9##########The following Update routine is executed when the Upd operation is selected.                                                             
  140. 9Update                                                                                                                                             
  141. 9                 Setoff                            U1                                                                                              
  142. 9                 Find   1KEY1                      I0                                                                                              
  143. 9                 Perform                              I/O_ok                                                                                       
  144. 9                 Perform                              Disp*                                                                                        
  145. 9##########The "Disp*" routine is executed after the record is found to display the field values.                                                     9                 Perform                              AccData                                                                                      
  146. 9              A2 Seton                             U1 UpdEnd                                                                                       
  147. 9                 Rewrite1                          I0                                                                                              
  148. 9                 Perform                              I/O_ok                                                                                       
  149. 9UpdEnd           Return                                                                                                                            
  150. 9##########          ----- Update routine end ---------                                                                                             
  151. 9##########The following Delete routine is executed when the Del operation is selected.                                                             
  152. 9Delete                                                                                                                                             
  153. 9                 Setoff                            D1                                                                                              
  154. 9                 Find   1KEY1                      I0                                                                                              
  155. 9                 Perform                              I/O_ok                                                                                       
  156. 9                 Perform                              Disp*                                                                                        
  157. 9                 Message!DelMsg  +2       +1       D1                                                                                              
  158. 9##########The record is deleted after presentation of a warning message.                                                                           
  159. 9                 If      Delete                                                                                                                    
  160. 9                 Delete 1                          I0                                                                                              
  161. 9                 Perform                              I/O_ok                                                                                       
  162. 9##########After execution of the Delete routine a record is located and displayed.                                                                 
  163. 9                 Perform                              FindCur                                                                                      
  164. 9                 EndIf                                                                                                                             
  165. 9DelEnd           Return                                                                                                                            
  166. 9##########          ----- Delete routine end ---------                                                                                             
  167. 9##########The following Locate routine is executed when the Find operation is selected.                                                            
  168. 9Locate                                                                                                                                             
  169. 9                 Setoff                            L1                                                                                              
  170. 9                 Perform                              First                                                                                        
  171. 9                 Perform                              AccKey                                                                                       
  172. 9##########The searched key value is entered by the user in the "AccKey" routine.                                                                   
  173. 9                 Perform                              FindCur                                                                                      
  174. 9                 If      Locate                                                                                                                    
  175. 9                 Seton                             L1                                                                                              
  176. 9                 EndIf                                                                                                                             
  177. 9LocEnd           Return                                                                                                                            
  178. 9##########          ----- Locate routine end ---------                                                                                             
  179. 9##########The display routine is called by other routines.                                                                                         
  180. 9Display                                                                                                                                            
  181. 9                 Find   1KEY1                      I0                                                                                              
  182. 9                 Perform                              I/O_ok                                                                                       
  183. 9                 Perform                              Disp*                                                                                          9                 Return                                                                                                                            
  184. 9##########          ----- Display routine end ---------                                                                                            
  185. 9##########The first routine is executed when necessary to intiate the field values.                                                                
  186. 9First            Moves  0BLANK            1Family                                                                                                  
  187. 9                 Setoff                            F1                                                                                              
  188. 9                 Return                                                                                                                            
  189. 9##########          ----- First routine end ---------                                                                                              
  190. 9##########The last routine is executed when necessary to maximize the field values.                                                                
  191. 9Last             Moves  0MaxStr           1Family                                                                                                  
  192. 9                 Setoff                            L1                                                                                              
  193. 9                 Return                                                                                                                            
  194. 9##########          ----- Last routine end ---------                                                                                               
  195. 9##########The next routine is executed when necessary to read the next record.                                                                     
  196. 9Next             Setoff                            N1                                                                                              
  197. 9                 Read   1KEY1                      I0                                                                                              
  198. 9                 Perform                              I/O_ok                                                                                       
  199. 9              I0 Seton                             N1                                                                                              
  200. 9                 Return                                                                                                                            
  201. 9##########          ----- Next routine end ---------                                                                                               
  202. 9##########Prev routine is performed when we need to read the previous record.                                                                      
  203. 9Prev             Setoff                            P1                                                                                              
  204. 9                 Prev   1KEY1                      I0                                                                                              
  205. 9                 Perform                              I/O_ok                                                                                       
  206. 9              I0 Seton                             P1                                                                                              
  207. 9                 Return                                                                                                                            
  208. 9##########          ----- Prev routine end ---------                                                                                               
  209. 9##########The following routine is called from other routines in order to locate and display a record.                                             
  210. 9FindCur                                                                                                                                            
  211. 9                 Find   1KEY1                      I0                                                                                              
  212. 9                 Perform                              I/O_ok                                                                                       
  213. 9                 If      Locate                                                                                                                    
  214. 9                 Read   1KEY1                      I0                                                                                              
  215. 9                 Perform                              I/O_ok                                                                                       
  216. 9                 EndIf                                                                                                                             
  217. 9                 If      Locate                                                                                                                    
  218. 9                 Prev   1KEY1                      I0                                                                                              
  219. 9                 Perform                              I/O_ok                                                                                       
  220. 9                 EndIf                                                                                                                             
  221. 9                 If      Locate                                                                                                                    
  222. 9                 Perform                              First                                                                                        
  223. 9                 EndIf                                                                                                                             
  224. 9                 Perform                              Disp*                                                                                        
  225. 9                 Return                                                                                                                            
  226. 9##########                        -------- Find Current record routine end -------                                                                 
  227. 9I/O_ok                                                                                                                                             
  228. 9              I0-Message!WriteErr+1       +1                                                                                                       
  229. 9              I0-Seton                             I1                                                                                              
  230. 9              I0-Seton                             U1                                                                                              
  231. 9              I0-Seton                             D1                                                                                              
  232. 9              I0-Seton                             L1                                                                                              
  233. 9              I0-Seton                             N1                                                                                              
  234. 9              I0-Seton                             P1                                                                                              
  235. 9                 Return                                                                                                                            
  236. 9##########                ------ End I/O Case                                                                                                      
  237. 9##########All user data are entered in the KEY fileds here.                                                                                        
  238. 9AccKey           Accept *KEY                       A1                                                                                              
  239. 9                 Return                                                                                                                            
  240. 9##########All user data are entered in the DATA fileds here.                                                                                       
  241. 9AccData          Accept *DATA                      A2                                                                                              
  242. 9                 Return                                                                                                                            
  243. 9Disp*            Display*KEY                                                                                                                       
  244. 9                 Display*DATA                                                                                                                      
  245. 9                 Return                                                                                                                            
  246. BDelete  ^D1      ^=       ^=                                                                                                                       
  247. BLocate  ^I0      ^+       ^+                                                                                                                       
  248. BNotQuit ^Q5      ^=       ^=                                                                                                                       
  249. BAddLoop ^I1      ^=       ^=                                                                                                                       
  250. BUpdLoop ^U1      ^=       ^=                                                                                                                       
  251. 0