home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DBAPG.ARC / DOS-.PRG < prev    next >
Encoding:
Text File  |  1984-08-12  |  3.5 KB  |  115 lines

  1. * Program.: DOS-.PRG
  2. * Author..: Luis A. Castro
  3. * Date....: 01/22/84 
  4. * Notice..: Copyright 1984, Luis A. Castro, All Rights Reserved.
  5. * Version.: dBASE II, version 2.4
  6. * Notes...: Front-end program to utilize the DOS subroutines:
  7. *           DOS-STAT, DOS-COPY, DOS-PATH, DOS-TIME, DOS-DATE.
  8. * Local...: string, select
  9. *
  10. SET TALK OFF 
  11. SET BELL OFF
  12. SET COLON OFF
  13. ERASE
  14. @ 2, 0 SAY "D O S   Assembly  Subroutines  Demonstration"
  15. @ 2,72 SAY DATE()
  16. @ 3, 0 SAY "========================================"
  17. @ 3,40 SAY "========================================"
  18. STORE "X" TO select
  19. DO WHILE select <> " "
  20.    @ 11,0
  21.    STORE " " TO select
  22.    @  5,0 SAY "1. DOS-STAT =  disk space remaining"
  23.    @  6,0 SAY "2. DOS-COPY =  copy utility"
  24.    @  7,0 SAY "3. DOS-PATH =  directory functions"
  25.    @  8,0 SAY "4. DOS-TIME =  system time"
  26.    @  9,0 SAY "5. DOS-DATE =  system date"
  27.    @ 10,0 GET select PICTURE "!"
  28.    READ
  29.    IF select = " " .OR. .NOT. select $ "12345"
  30.       LOOP
  31.    ENDIF
  32.    @ 12,0
  33.    @ 13,0
  34.    @ 14,0
  35.    @ 10,0 SAY " "
  36.    * ---Execute a routine.
  37.    DO CASE
  38.       CASE select = "1"
  39.          * ---DOS-STAT =  disk space remaining.
  40.          STORE " " TO drive
  41.          @ 11,0 SAY "Enter a drive letter " GET drive PICTURE "!"
  42.          READ
  43.          IF drive <> " "
  44.             @ 11,0 SAY "E"
  45.             DO Dos-stat
  46.             IF is:error
  47.                ? "UNSUCCESSFUL"
  48.             ELSE
  49.                ? "DISK SPACE REMAINING = ",storage," BYTES "
  50.                ?? storage/1024," KILOBYTES"
  51.             ENDIF
  52.             RELEASE storage
  53.          ENDIF
  54.          RELEASE drive,is:error
  55.       CASE select = "2"
  56.       * ---DOS-COPY =  copy utility
  57.          ? "Enter <source> <destination> of COPY "
  58.          ACCEPT TO string
  59.          STORE !(TRIM(string)) TO string
  60.          DO CASE
  61.             CASE string = " "
  62.             CASE @(" ",string) > 0 .AND.;
  63.                  @(" ",string) < LEN(string)
  64.                STORE $(string,1,@(" ",string)-1) TO source
  65.                STORE $(string,@(" ",string)+1) TO dest
  66.                DO Dos-copy
  67.                IF is:error
  68.                   ? "FILE I/O ERROR"
  69.                ELSE
  70.                   ? "COPY COMPLETED"
  71.                ENDIF
  72.                RELEASE source,dest,is:error
  73.          ENDCASE
  74.       CASE select = "3"
  75.       * ---DOS-PATH = directory functions.
  76.          ? "Enter <[MD,RD,CD]> <pathname>"
  77.          ACCEPT TO string
  78.          STORE !(string) TO string
  79.          DO CASE
  80.             CASE string = " "
  81.             CASE @(" ",string) > 1 .AND.;
  82.                  @(" ",string) < LEN(string)
  83.                STORE $(string,1,@(" ",string)-1) TO command
  84.                STORE $(string,@(" ",string)+1) TO path
  85.                DO Dos-path
  86.                IF is:error
  87.                   ? "UN-SUCCESSFUL"
  88.                ELSE
  89.                   ? "SUCCESSFUL"
  90.                ENDIF
  91.                RELEASE command,path,is:error
  92.          ENDCASE
  93.       CASE select = "4"
  94.       * ---DOS-TIME = system time.
  95.          DO Dos-time
  96.          ? 
  97.          ? "MILITARY TIME: ",time:dos
  98.          ? " [AM/PM] TIME: ",time:ampm
  99.          RELEASE time:dos,time:ampm
  100.       CASE select = "5"
  101.       * --- DOS-DATE = system date.
  102.          DO Dos-date
  103.          ?
  104.          ? "Current date is ",date:dos 
  105.          RELEASE date:dos
  106.    ENDCASE
  107.    @ 11,0
  108. ENDDO
  109. SET BELL ON
  110. SET TALK ON
  111. SET COLON ON
  112. RELEASE string, select
  113. RETURN
  114. * EOF: DOS-.PRG
  115.