home *** CD-ROM | disk | FTP | other *** search
- 100 ' *****************************************************
- 110 ' *** TEST PROGRAM FOR BASSUB.OBJ ***
- 120 ' *****************************************************
- 130 '
- 140 ' IMPORTANT :
- 150 '
- 160 ' The sub-directory name must end with a null
- 170 ' character or CHR$(0).
- 180 '
- 200 ' AVAILABLE FUNCTIONS :
- 210 '
- 220 ' RETREG : returns segment register values
- 230 ' CS%, DS%, ES%, SS%
- 240 ' will contain values of the registers
- 250 '
- 300 ' MKDIR : Make sub-directory DIR$
- 310 ' ER% = -1 (True) if there is an error
- 320 '
- 400 ' CHDIR : Change sub-directory DIR$
- 410 ' ER% = -1 (True) if there is an error
- 420 '
- 500 ' RMDIR : Remove sub-directory DIR$
- 510 ' ER% = -1 (True) if there is an error
- 520 '
- 600 ' LINKING :
- 610 '
- 620 ' When linking the library and the compiled program
- 630 ' remember to specify BASSUB.OBJ. If not specified, the
- 640 ' above functions will not be available.
- 650 '
- 700 ' EXAMPLE PROGRAM :
- 710 '
- 720 ' The following is an example program :
- 730 '
- 740 ' [ 1 ] It will print the values of the
- 750 ' segment registers.
- 760 ' [ 2 ] It will create sud-dir "\TEST"
- 770 ' [ 3 ] It will change to sub-dir "\TEST"
- 780 ' [ 4 ] It will then change to "\"
- 790 ' [ 5 ] Finally, it will remove "\TEST"
- 800 '
- 900 ' HAVE FUN !
- 910 '
- 920 ' For more information refer to the DOS 2.00 manual,
- 930 ' the BASIC manual, and the BASIC Compiler Manual.
- 940 '
- 950 ' PROGRAM WRITTEN BY :
- 960 '
- 970 ' SWEE BOON LIM
- 980 ' 1231 4th STREET, SW, WASHINGTON, DC 20024
- 990 ' TEL : 646-0903, 646-0904
- 995 ' Please call if you discover any problems
- 997 ' with the subroutines. Thank you.
- 999 '
- 1000 CS% = 0
- 1010 DS% = 0
- 1020 ES% = 0
- 1030 SS% = 0
- 1100 CALL RETREG (CS%,DS%,ES%,SS%)
- 1110 PRINT "CS : ";HEX$(CS%)
- 1120 PRINT "DS : ";HEX$(DS%)
- 1130 PRINT "ES : ";HEX$(ES%)
- 1140 PRINT "SS : ";HEX$(SS%)
- 1200 NUL$ = CHR$(0)
- 1210 DIR$ = "C:\TEST"+NUL$
- 1230 CALL MKDIR (DIR$,ER%) : PRINT "MAKE SUB-DIR : "; : GOSUB 2000
- 1240 CALL CHDIR (DIR$,ER%) : PRINT "CHANGE SUB-DIR : "; : GOSUB 2000
- 1250 D$ = "C:\"+NUL$
- 1260 CALL CHDIR (D$,ER%) : PRINT "GOTO ROOT DIR : "; : GOSUB 2000
- 1280 CALL RMDIR (DIR$,ER%) : PRINT "REMOVE SUB-DIR : "; : GOSUB 2000
- 1997 PRINT
- 1998 PRINT "Press any key to continue.";
- 1999 K$ = INKEY$ : IF K$ = "" THEN 1999 ELSE END
- 2000 IF ER% THEN PRINT "FAILURE" ELSE PRINT "SUCCESSFUL"
- 2010 RETURN
-