home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / BAS_SUB.ZIP / BASSUB.ASC < prev    next >
Encoding:
Text File  |  1985-04-19  |  2.8 KB  |  76 lines

  1. 100 ' *****************************************************
  2. 110 ' ***         TEST PROGRAM FOR BASSUB.OBJ           ***
  3. 120 ' *****************************************************
  4. 130 '
  5. 140 ' IMPORTANT :
  6. 150 '
  7. 160 '     The sub-directory name must end with a null
  8. 170 ' character or CHR$(0).
  9. 180 '
  10. 200 ' AVAILABLE FUNCTIONS :
  11. 210 '
  12. 220 '     RETREG  : returns segment register values
  13. 230 '                   CS%, DS%, ES%, SS%
  14. 240 '                   will contain values of the registers
  15. 250 '
  16. 300 '     MKDIR   : Make sub-directory DIR$
  17. 310 '                   ER% = -1 (True) if there is an error
  18. 320 '
  19. 400 '     CHDIR   : Change sub-directory DIR$
  20. 410 '                   ER% = -1 (True) if there is an error
  21. 420 '
  22. 500 '     RMDIR   : Remove sub-directory DIR$
  23. 510 '                   ER% = -1 (True) if there is an error
  24. 520 '
  25. 600 ' LINKING :
  26. 610 '
  27. 620 '     When linking the library and the compiled program
  28. 630 ' remember to specify BASSUB.OBJ. If not specified, the
  29. 640 ' above functions will not be available.
  30. 650 '
  31. 700 ' EXAMPLE PROGRAM :
  32. 710 '
  33. 720 '     The following is an example program :
  34. 730 '
  35. 740 '           [ 1 ] It will print the values of the
  36. 750 '                 segment registers.
  37. 760 '           [ 2 ] It will create sud-dir "\TEST"
  38. 770 '           [ 3 ] It will change to sub-dir "\TEST"
  39. 780 '           [ 4 ] It will then change to "\"
  40. 790 '           [ 5 ] Finally, it will remove "\TEST"
  41. 800 '
  42. 900 ' HAVE FUN !
  43. 910 '
  44. 920 '     For more information refer to the DOS 2.00 manual,
  45. 930 ' the BASIC manual, and the BASIC Compiler Manual.
  46. 940 '
  47. 950 ' PROGRAM WRITTEN BY :
  48. 960 '
  49. 970 '     SWEE BOON LIM
  50. 980 '     1231 4th STREET, SW, WASHINGTON, DC 20024
  51. 990 '     TEL : 646-0903, 646-0904
  52. 995 '     Please call if you discover any problems
  53. 997 ' with the subroutines. Thank you.
  54. 999 '
  55. 1000 CS% = 0
  56. 1010 DS% = 0
  57. 1020 ES% = 0
  58. 1030 SS% = 0
  59. 1100 CALL RETREG (CS%,DS%,ES%,SS%)
  60. 1110 PRINT "CS : ";HEX$(CS%)
  61. 1120 PRINT "DS : ";HEX$(DS%)
  62. 1130 PRINT "ES : ";HEX$(ES%)
  63. 1140 PRINT "SS : ";HEX$(SS%)
  64. 1200 NUL$ = CHR$(0)
  65. 1210 DIR$ = "C:\TEST"+NUL$
  66. 1230 CALL MKDIR (DIR$,ER%) : PRINT "MAKE SUB-DIR : "; : GOSUB 2000
  67. 1240 CALL CHDIR (DIR$,ER%) : PRINT "CHANGE SUB-DIR : "; : GOSUB 2000
  68. 1250 D$ = "C:\"+NUL$
  69. 1260 CALL CHDIR (D$,ER%) : PRINT "GOTO ROOT DIR : "; : GOSUB 2000
  70. 1280 CALL RMDIR (DIR$,ER%) : PRINT "REMOVE SUB-DIR : "; : GOSUB 2000
  71. 1997 PRINT
  72. 1998 PRINT "Press any key to continue.";
  73. 1999 K$ = INKEY$ : IF K$ = "" THEN 1999 ELSE END
  74. 2000 IF ER% THEN PRINT "FAILURE" ELSE PRINT "SUCCESSFUL"
  75. 2010 RETURN
  76.