home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DB2IOS.ARC / SIG-M.PRG < prev    next >
Encoding:
Text File  |  1983-01-04  |  10.6 KB  |  231 lines

  1. * SIG/M.CMD  08/18/83
  2. * THIS IS THE STARTING PROGRAM IN A RATHER COMPREHENSIVE DUAL DATA
  3. * BASE. THE KEY PROGRAMS ARE MAIN.SIG AND MAIN.INV. MENU.SIG IS
  4. * THE "TRAFFIC COP." THE ORDERS DATA BASE IS CALLED SIG/M. THE
  5. * INVENTORY DATA BASE IS CALLED STOCK. WHEN AN ORDER IS ENTERED
  6. * THE PROGRAM DETERMINES IT VALIDITY, DELETES IT FROM INVENTORY
  7. * OR BACKORDERS IT. IT PRINTS ALL SORTS OF REPORTS, ETC.
  8. * A TUTORIAL DATA BASE WAS ISSUED ON SIG/M VOLUME 110. BECAUSE OF THE
  9. * LARGE NUMBER OF REQUESTS FOR THAT VOLUME (COUPLED WITH A SIG/M RE-
  10. * QUIREMENT FOR AN INVENTORY DATA BASE) WITH THE SIGNIFICANT HELP OF
  11. * HARRY VAN TASSELL I WROTE THIS PROGRAM. THE VOLUME 110 DATA BASE
  12. * IS NOT MAXIMIZED FOR SPEED - THIS IS. ON OUR WORKING VERSION OF THIS PROGRAM
  13. * WE REMOVED ALL COMMENTS AND SET UP EVERYTHING USING FASTBASE. IN THIS
  14. * LIBRARY FILE WE HAVE LEFT IT AS PRETTY PRINTED BY FASTBASE FOR EASE IN
  15. * UNDERSTANDING. SPEAKING OF FASTBASE, I HAVE TRIED MOST OF THE dBASE
  16. * GENERATORS AND EXCEPT FOR ZIP FIND THEM OF LITTLE VALUE. I RECENTLY
  17. * PURCHASED FASTBASE FROM FOURCOLOR DATA SYSTEMS IN DAYTON AND WAS
  18. * SO IMPRESSED WITH SOME OF THE THINGS IT COULD DO THAT I INCLUDED AS
  19. * SEARCH1.SIG THE SEARCH FILE IT GENERATED. IT FINDS ANY STRING ANY
  20. * PLACE IN ANY FIELD AND IN EVERY RECORD. ITS INDEX SEARCH IS ALSO
  21. * EXCELLENT AND THE DISPLAY IN SO-CALLED FAST MODE IF FAR BETTER
  22. * THAN THE dBASE NORMAL DISPLAY.
  23. * THE PROGRAM IS PRETTY MUCH SELF EXPLANATORY. TRY IT - SEE HOW IT
  24. * WORKS AND ADJUST IT FOR YOUR OWN REQUIREMENTS.  PLEASE LET US KNOW OF
  25. * ANY PROBLEMS AND SEND US ANY IMPROVEMENTS.
  26. *                                        Steve Leon
  27. *                                        200 Winston Drive
  28. *                                        Cliffside Park, NJ 07010
  29. *                                        (201) 886-1658
  30. * This initialization program is run once, when the program is first started
  31. * it will initialize the variables, set up environment and do a sign-on.
  32. * Place all command which affect the entire system here.
  33. * place your choice of intensity, confirm, etc. here.
  34. * If you want to use highlighting, we suggest you not do it
  35. * here. Do it in connection with the "IF FIRST" on the main
  36. * screen calls. See MAIN.SIG and MAIN.INV
  37. SET TALK OFF
  38. SET INTENSITY OFF
  39. * THIS PROGRAM RUNS FINE UNDER CPM/86. JUST CHANGE ITS NAME TO SIG/M.PRG
  40. * WE ARE ABLE TO DISTINGUISH BETWEEN CP/M 80 AND CPM/86 ON ALL
  41. * SYSTEMS WE HAVE TRIED.  IF YOU HAVE A PROBLEM WITH YOUR SYSTEM
  42. * JUST TAKE OUT THE AUTOMATIC RECOGNITION AND/OR AUTOMATIC INPUT.
  43. * HOWEVER, NEVER USE A CP/M 80 MEMORY FILE ON CP/86 AND VICE
  44. * VERSA. JUST DELETE IT - THE PROGRAM WILL CREATE A NEW ONE
  45. * HERE WE CREATE OUR VARIABLES FOR ADDING RECORDS TO THE .SIG FILES
  46. IF .NOT. FILE("add.mem")
  47.     STORE '         ' TO morder
  48.     STORE ' ' TO mcomp
  49.     STORE '                    ' TO mlname
  50.     STORE '               ' TO mfname
  51.     STORE '                                   ' TO maddr1
  52.     STORE '                                   ' TO maddr2
  53.     STORE '                                   ' TO maddr3
  54.     STORE '                         ' TO mcity
  55.     STORE '  ' TO mstate
  56.     STORE '     ' TO mzip
  57.     STORE 000.00 TO mamt
  58.     STORE 999 TO mvol
  59.     STORE '            ' TO mstatus
  60.     STORE '                                                                                                                                    ' TO mvol1
  61.     STORE '        ' TO mentered
  62.     STORE '        ' TO mshipped
  63.     STORE '                                                                  ' TO mrem1
  64.     STORE '                                                                  ' TO mrem2
  65.     STORE '                                                                                                  ' TO mbo
  66.     STORE ' ' TO mcatalog
  67.     STORE '        ' TO mbo:ship
  68.     STORE '        ' TO mbo2:ship
  69.     STORE '        ' TO mdayu
  70.     STORE '             ' TO mstatus
  71.     SAVE TO ADD
  72.     RELEASE ALL
  73. ENDIF
  74. ERASE
  75. ? '   *>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<'
  76. ? '   *                                                                      *'
  77. ? '   *               AMATEUR COMPUTER GROUP OF NEW JERSEY                   *'
  78. ? '   *                                                                      *'
  79. ? '   *                              SIG/M                                   *'
  80. ? '   *                 LIBRARY OF PUBLIC DOMAIN SOFTWARE                    *'
  81. ? '   *                                                                      *'
  82. ? '   *           A dBASEII Program by Steve Leon for..........              *'
  83. ? '   *                                                                      *'
  84. ? '   *              DISK INVENTORY            ORDER PROCESSING              *'
  85. ? '   *                 SHIPPING                  DISK LABELS                *'
  86. ? '   *                                                                      *'
  87. ? '   *                                              Vers 1.0 Aug. 25, 1983  *'
  88. ? '   *>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*'
  89. * If you have a Compupro System Support Board leave the following code in.
  90. * It automatically sets the date. Otherwise, since the program requires
  91. * that the date be entered, you will have to manually enter the date in
  92. * response to the prompt.
  93. * Read date from Compupro System Support board, store the date into DBASE
  94. * DATE() function.  See file DATETIME.ASM for assembly language source code
  95. * from which the POKE list values are determined.
  96. *
  97. *
  98. *STORE 41984 TO adr       
  99. *in cp/m 80 there is a jmp at location 0 & 5
  100. *IF (PEEK(0)=195 .AND. PEEK(5)=195)
  101. *use 8080 code
  102. *POKE adr ,35,17,37,164,14,6,6,2,26,19,198,16,211,90,254,21,219,91,194;
  103. *,23,164,214,8,198,48,119,35,5,194,8,164,35,13,194,6,164;
  104. *,201,10,9,8,7,12,11,5,4,3,2,1,0
  105. *ELSE                             
  106. *use 8086 code
  107. *POKE adr ,67,190,38,164,177,6,181,2,138,4,70,4,16,230,90,60,21,228,91,117;
  108. *,2,44,8,4,48,136,7,67,254,205,117,232,67,254,201,117,225,195,10,9;
  109. *,8,7,12,11,5,4,3,2,1,0
  110. *ENDIF
  111. *SET CALL TO adr       
  112. *STORE '  /  /  ,  :  :  ' TO mem:var
  113. *CALL mem:var
  114. *STORE $(mem:var,1,8) TO mdate
  115. *STORE $(mem:var,10,8) TO mtime
  116. *SET DATE  TO &mdate
  117. ***************************************************************************
  118. *@ 17,10 SAY 'Today is ' + mdate 
  119. *@ 17,32 SAY '....and the time is  ' + mtime 
  120. ****************************************************************************
  121. * IF YOU DO NOT HAVE AUTOMATIC DATE READ - YOU WILL HAVE TO INPUT DATENPU
  122. * THE PROGRAM REQUIRES THAT YOU INPUT A DATE AND A DATE VALIDATION PROGRAM
  123. * BY WILLIAM G. HURST WE FOUND IN dNEWS IS INCLUDED.
  124. DO WHILE $(DATE(),1,2)='00'
  125.     STORE '        ' TO date:var
  126.     @ 18,15 SAY 'Enter date as MM/DD/YY '
  127.     @ 18,43 GET date:var  PICTURE '##/##/##'
  128.     READ
  129.     CLEAR GETS
  130.     * flag set to'1'
  131.     STORE '1' TO invalid
  132.     DO WHILE invalid = '1'
  133.         STORE $(date:var,1,2) TO mm1
  134.         STORE VAL(mm1) TO mm
  135.         STORE $(date:var,4,2) to dd1
  136.         STORE VAL(dd1) to dd
  137.         STORE $(date:var,7,2) TO yy1
  138.         STORE VAL(yy1) TO yy
  139.         * Each case below is a negative test. Date is valid
  140.         * if none of the tests prove true.
  141.         DO CASE
  142.             * check for improper month, day or year
  143.             CASE mm<1 .OR. mm>12 .OR. dd<1 .OR. dd>31 .OR. yy<83
  144.                 STORE '        ' TO date:var
  145.                 @ 20,00
  146.                 @ 20,15 SAY 'NO SUCH DATE - PLEASE TRY AGAIN'
  147.                 @ 18,43 GET date:var PICTURE '##/##/##'
  148.                 READ
  149.                 CLEAR GETS
  150.                 * check for 31 days in 30 day month
  151.                 CASE((mm<8.AND.mm/2=INT(mm/2)).OR.(mm>7.AND.;
  152.                 mm/2<>INT(mm/2))).AND.dd>30
  153.                 * invalid date:user is prompted for reentry
  154.                 STORE '        ' TO date:var
  155.                 @ 20,00
  156.                 @ 20,15 SAY 'SORRY - WRONG NUMBER OF DAYS FOR THE MONTH - TRY AGAIN'
  157.                 @ 18,43 GET date:var PICTURE '##/##/##'
  158.                 READ
  159.                 CLEAR GETS
  160.                 * test for February, if month is not Feb, and it has
  161.                 * 'failed' the tests so far the date is OK
  162.             CASE mm<>2
  163.                 *date is OK;invalid = '0' drops out of DO WHILE LOOP
  164.                 STORE '0' TO invalid
  165.                 * if month is Feb., check number of days in non-leap year
  166.                 * does not exceed 28
  167.                 CASE(yy/4<>INT(yy/4).OR.(yy/100=INT(yy/100).AND.;
  168.                 yy/400<>INT(yy/400))).AND. dd>28
  169.                 * invalid date, user is prompted for reentry
  170.                 STORE '        ' TO date:var
  171.                 @ 20,00
  172.                 @ 20,15 SAY 'REMEMBER - FEBRUARY IS A SHORT MONTH! - PLEASE TRY AGAIN'
  173.                 @ 18,43 GET date:var PICTURE '##/##/##'
  174.                 READ
  175.                 CLEAR GETS
  176.                 * finally, check days in leap year February <30
  177.             CASE dd=30
  178.                 * invalid date; user is prompted for reentry
  179.                 STORE '        ' TO date:var
  180.                 @ 20,00
  181.                 @ 20,43 'EVEN A LEAP YEAR FEBRUARY ONLY HAS 29 DAYS - PLEASE REENTER'
  182.                 @ 18,43  GET datevar PICTURE '##/##/##'
  183.                 READ
  184.                 CLEAR GETS
  185.             OTHERWISE
  186.                 @ 20,00
  187.                 STORE '0' TO invalid
  188.         ENDCASE
  189.         * end of DO WHILE loop if valid = '0' program terminates
  190.         * if invalid #'0'loop repeats
  191.     ENDDO while invalid
  192.     RELEASE nn1,dd1,yy1,dd,yy
  193.     SET DATE TO &date:var
  194. ENDDO while date
  195. * set up bell
  196. STORE 'Y' TO command
  197. @ 20,00
  198. @ 19,15 SAY'Do you wish to use signal beep ? ' GET command PICTURE '!'
  199. READ
  200. IF command = 'N'
  201.     SET BELL OFF
  202. ENDIF command = N
  203. * set up drive for data disk
  204. * Thanks to Harry Van Tassell we store the default drive to dr
  205. * However, if you do not keep the data on the default drive we suggest
  206. * you change the code to eliminate the drives you do not have. This
  207. * way you cannot accidentally select a drive
  208. STORE 41984 TO ADDRESS
  209. STORE ' ' TO dr
  210. * find out if you are running under CP/M 80
  211. IF (PEEK(0) = 195 .AND. PEEK(5) = 195)
  212.     *8080 code
  213.     POKE ADDRESS ,35,229,14,25,205,5,0,225,198,65,119,201
  214. ELSE
  215.     *8086 code
  216.     POKE ADDRESS,67,83,177,25,205,224,4,65,91,136,7,195
  217. ENDIF peek
  218. SET CALL TO ADDRESS
  219. CALL dr
  220. RELEASE ADDRESS
  221. @ 20,15 SAY 'In which drive is the DATA disk ? ' GET dr PICTURE '!'
  222. READ
  223. DO WHILE @(dr,'ABCDM') = 0
  224.     @ 20,15 SAY 'In which drive is the DATA disk ? ' GET dr PICTURE '!'
  225.     READ
  226. ENDDO while @dr
  227. * poke drive letter into memory 039 hex
  228. POKE 063,(64+@(dr,'ABCDM'))
  229. RELEASE ALL
  230. DO MENU.SIG
  231.