$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) '/*------------------------------------------------------------------*/ $CODE SEG "MLIB4" '/*------------------------------------------------------------------*/ ' CDIR DIR$ ' Creates a directory structure. ' Use this funtion to ensure major and sub directories exist. ' EXAMPLE: CDIR "c:\code\mlib\asm" '/*------------------------------------------------------------------*/ SUB CDIR(BYVAL DIRECTORY$) PUBLIC '/* --- Remove Trailing Slash ---*/ DIRECTORY$ = RTRIM$(DIRECTORY$, "\") BACKSLASH = INSTR(DIRECTORY$, "\") '/* --- Look for Directory Levels ---*/ DO IF BACKSLASH THEN TMP$ = LEFT$(DIRECTORY$, BACKSLASH-1) ELSE TMP$ = DIRECTORY$ END IF '/* --- Directory NOT There? ---*/ IF LEN(DIR$(TMP$+"\NUL")) = 0 THEN '/* --- Drive Present? ---*/ IF (BACKSLASH = 1) OR (RIGHT$(TMP$, 1) = ":") THEN EXIT SUB END IF '/* --- Make Directory ---*/ MKDIR TMP$ END IF '/* --- Another Level? ---*/ IF BACKSLASH THEN BACKSLASH = INSTR(BACKSLASH+1, DIRECTORY$, "\") ELSE EXIT DO END IF LOOP END SUB '/*------------------------------------------------------------------*/ ' $INCLUDE "\CODE\MLIB\MLIB.INC" ' CDIR "C:\ZIP\TEMP\LAST\" ' Y$ = GETKEY '/*------------------------------------------------------------------*/