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

  1. 1Data Entry                Main            regular  read/write                                                                                      
  2. 31SG      read/writeyes                                                                                                                             
  3. 4DelMsg  Delete the record                                                                                                                          
  4. 4Exist   Record Exist                                                                                                                               
  5. 4Exit    Exit                                                                                                                                       
  6. 4WriteErrFile Access Error                                                                                                                            5Date0   date0          Date   European 10  100/00/0000;                                                                                            
  7. 5MaxReal MaxReal        Float  1        10  19999999999;                                                                                              5MaxLong MaxLong        Long   Positive 10  12147480000;                                                                                            
  8. 5MaxInt  MaxInt         IntegerPositive  5  132767;                                                                                                 
  9. 5MaxStr  MaxStr         Char   Lf-T-Rgh 20  1zzzzzzzzzzzzzzzzzzzz;                                                                                  
  10. 5MaxDate MaxDate        Date   American 10  112/31/9999;                                                                                            
  11. 5MaxTime MaxTime        Time   Time      8  123:59:59;                                                                                              
  12. 5MaxByte MaxByte        Byte   Positive  4  1127;                                                                                                   
  13. 5Zero    zero           Long   Positive1  1  0;                                                                                                     
  14. 5One     One            Long   Positive1  1  1;                                                                                                     
  15. 5Two     Two            Long   Positive 1 1  2;                                                                                                     
  16. 5Title   title          Char   Lf-T-Rgh20 1  Data entry;                                                                                            
  17. 5BLANK   blank          Char   Lf-T-Rgh1  1   ;                                                                                                     
  18. 5Dummy   dummy          Char   Lf-T-Rgh10 1  1;                                                                                                     
  19. 6MAIN      2.000  7.632 68.500  1.316L_FRAME         DARKGREEN       0Title                   Data    0.5    0.5    6      8                          7MAIN    1Family  0Dummy    48.667  0.158 15.65   1.000S_ARISTO        BACKGROUND      BLUE            KEY              NONE                          9Main          Z0=New-Scr                  0Title                                                                                                   
  20. 9                 Edit   #MAIN             0Zero    Z1                                                                                              
  21. 9                 Clr-Lin#MAIN                                                                                                                      
  22. 9                 Return                                                                                                                            
  23. 9##########The following Insert routine is executed when either the INSERT or APPEND edit operation                                                   9##########is selected.                                                                                                                               9Insert                                                                                                                                               9                 Setoff                            I1                                                                                                9                 Perform                              First                                                                                          9##########The "First" routine is used here to initiate fields and clear them of previous values.                                                     9                 Perform                              Disp*                                                                                          9Ins1             Perform                              AccKey                                                                                         9##########The key fields data are entered by the user in the "AccKey" routine. If the user aborts the                                                9##########data entry, the flag A1 is set to ON and the Insert routine is aborted, returning the ON status                                            9##########of the I1 flag to the Edit command.                                                                                                        9              A1 Seton                             I1 InsEnd                                                                                         9                 Find   1KEY1                      I0                                                                                              
  24. 9                 Perform                              I/O_ok                                                                                         9##########The find command is executed to check if there is an existing record that has key field value                                              9##########entered.                                                                                                                                   9              I0=Message!Exist   +1       +1                                                                                                       
  25. 9              I0=Goto                                 Ins1                                                                                           9                 Perform                              AccData                                                                                        9##########The data fields data are entered by the user in the "AccData" routine. If the user aborts the                                              9##########data entry, the flag A2 is set to ON and the flow is diverted to the "Ins1" label.                                                         9              A2 Goto                                 Ins1                                                                                           9                 Write  1                          I0                                                                                              
  26. 9                 Perform                              I/O_ok                                                                                         9InsEnd           Return                                                                                                                              9##########          ----- Insert routine end ---------                                                                                               9##########The following Update routine is executed when UPDATE Edit operation is selected.                                                           9Update                                                                                                                                               9                 Setoff                            U1                                                                                                9                 Find   1KEY1                      I0                                                                                              
  27. 9                 Perform                              I/O_ok                                                                                         9                 Perform                              Disp*                                                                                          9##########The "Disp*" routine is executed after the record is found to display the field values.                                                     9                 Perform                              AccData                                                                                        9              A2 Seton                             U1 UpdEnd                                                                                         9                 Rewrite1                          I0                                                                                              
  28. 9                 Perform                              I/O_ok                                                                                         9UpdEnd           Return                                                                                                                              9##########          ----- Update routine end ---------                                                                                               9##########The following Delete routine is executed when DELETE Edit operation is selected.                                                           9Delete                                                                                                                                               9                 Setoff                            D1                                                                                                9                 Find   1KEY1                      I0                                                                                              
  29. 9                 Perform                              I/O_ok                                                                                         9                 Message!DelMsg  +2       +1       D1                                                                                                9##########The record is deleted after presentation of the warning message.                                                                           9                 If      Delete                                                                                                                      9                 Delete 1                          I0                                                                                              
  30. 9                 Perform                              I/O_ok                                                                                         9                 EndIf                                                                                                                               9DelEnd           Return                                                                                                                              9##########          ----- Delete routine end ---------                                                                                               9##########The following Locate routine is executed when LOCATE Edit operation is selected.                                                           9Locate                                                                                                                                               9                 Setoff                            L1                                                                                                9                 Perform                              First                                                                                          9                 Perform                              AccKey                                                                                         9##########The searched key value is entered by the user in the "AccKey" routine.                                                                     9              A1 Seton                             L1 LocEnd                                                                                         9                 Find   1KEY1                      I0                                                                                              
  31. 9                 Perform                              I/O_ok                                                                                         9                 If      Locate                                                                                                                      9                 Perform                              Next                                                                                         
  32. 9              N1 Seton                             I0                                                                                                9                 EndIf                                                                                                                               9                 If      Locate                                                                                                                      9                 Perform                              Prev                                                                                         
  33. 9              P1 Seton                             I0                                                                                                9                 EndIf                                                                                                                               9                 If      Locate                                                                                                                      9                 Seton                             L1                                                                                                9                 EndIf                                                                                                                               9LocEnd           Return                                                                                                                              9##########          ----- Locate routine end ---------                                                                                               9##########The display routine is called by the Edit command. There is no Display command in this                                                     9##########routine, because the display is initiated automatically by the Edit command.                                                               9Display                                                                                                                                              9                 Find   1KEY1                      I0                                                                                              
  34. 9                 Perform                              I/O_ok                                                                                         9                 Return                                                                                                                            
  35. 9##########          ----- Display routine end ---------                                                                                              9##########The first routine is executed when the Edit command needs to initiate the field values.                                                    9First            Moves  0BLANK            1Family                                                                                                  
  36. 9                 Setoff                            F1                                                                                              
  37. 9                 Return                                                                                                                            
  38. 9##########          ----- First routine end ---------                                                                                                9##########The last routine is executed when the Edit command needs to maximize the field values.                                                     9Last             Moves  0MaxStr           1Family                                                                                                  
  39. 9                 Setoff                            L1                                                                                              
  40. 9                 Return                                                                                                                            
  41. 9##########          ----- Last routine end ---------                                                                                                 9##########The next routine is executed when the Edit command needs to read the next record, either for                                               9##########internal use or as a result of user selection.                                                                                             9Next             Setoff                            N1                                                                                              
  42. 9                 Read   1KEY1                      I0                                                                                              
  43. 9                 Perform                              I/O_ok                                                                                         9              I0 Seton                             N1                                                                                                9                 Return                                                                                                                            
  44. 9##########          ----- Next routine end ---------                                                                                                 9##########The Prev routine is executed when the Edit command needs to read the previous record, either                                               9##########for internal use or as a result of user selection.                                                                                         9Prev             Setoff                            P1                                                                                              
  45. 9                 Prev   1KEY1                      I0                                                                                              
  46. 9                 Perform                              I/O_ok                                                                                         9              I0 Seton                             P1                                                                                                9                 Return                                                                                                                            
  47. 9##########          ----- Prev routine end ---------                                                                                                 9##########The Exit routine is executed when the Edit operation EXIT is selected.                                                                     9##########The EXIT operation ends Edit command execution.                                                                                            9Exit             Setoff                            E1                                                                                              
  48. 9                 Return                                                                                                                            
  49. 9##########The Exit- routine is executed when the Edit operation EXIT- is selected.                                                                   9##########The EXIT- operation ends Edit command execution and sets the Edit flag to "-".                                                             9Exit-            Setoff                            E1                                                                                              
  50. 9                 Find   1KEY1                      F1                                                                                              
  51. 9                 Return                                                                                                                            
  52. 9##########The Exit+ routine is executed when the Edit operation EXIT+ is selected.                                                                   9##########The EXIT+ operation ends Edit command execution and sets the Edit flag to "+".                                                             9Exit+            Message!Exit    0Two     +1       E1                                                                                              
  53. 9                 Return                                                                                                                            
  54. 9I/O_ok                                                                                                                                               9              I0-Message!WriteErr+1       +1                                                                                                         9              I0-Seton                             I1                                                                                                9              I0-Seton                             U1                                                                                                9              I0-Seton                             D1                                                                                                9              I0-Seton                             L1                                                                                                9              I0-Seton                             N1                                                                                                9              I0-Seton                             P1                                                                                                9                 Return                                                                                                                              9##########All user data are entered in the KEY fields here.                                                                                          9AccKey           Accept *KEY                       A1                                                                                                9                 Return                                                                                                                              9##########All user data are entered in the DATA fields here.                                                                                         9AccData          Accept *DATA                      A2                                                                                                9                 Return                                                                                                                              9Disp*            Display*KEY                                                                                                                       
  55. 9                 Display*DATA                                                                                                                      
  56. 9                 Return                                                                                                                              BDelete  ^D1      ^=       ^=                                                                                                                         BLocate  ^I0      ^+       ^+                                                                                                                         CMAIN    1      1      100.00015.65  DARKGRAY        0Title   0Title                                                                                
  57. KMAIN    1KEY1    DISPLAY Space   Display A0Displa~y                                                                                                
  58. K                 FIRST   Home    First   F1~First                                                                                                  
  59. K                 LAST    End     Last    L1~Last                                                                                                   
  60. K                 NEXT    Down    Next    N1~Next                                                                                                   
  61. K                 PREVIOUSUp      Prev    P1~Prev                                                                                                   
  62. K                 UPDATE  ->      Update  U1~Update                                                                                                 
  63. K                 INSERT  Ins     Insert  I1~Insert                                                                                                 
  64. K                 APPEND  =       Insert  I1~Append                                                                                                 
  65. K                 DELETE  Del     Delete  D1~Delete                                                                                                 
  66. K                 LOCATE  ?       Locate  L1~Locate                                                                                                   K                 EXIT    F3      Exit    E1~Exit                                                                                                   
  67. K                 EXIT-   F2      Exit-   E1Ch~oose                                                                                                 
  68. K                 EXIT+   F4      Exit+   E1~Confirmed Exit                                                                                         
  69. 0