home *** CD-ROM | disk | FTP | other *** search
/ Wacky Windows Stuff... / WACKY.iso / toolbook / only1.bas < prev    next >
BASIC Source File  |  1991-11-14  |  854b  |  33 lines

  1. DEFINT A-Z
  2. DECLARE SUB EnvOption (x%)
  3. 'this program is to get around the double processing involved if there's
  4. 'a single file in the upload directory
  5.  
  6. IF COMMAND$ = "" THEN
  7.    PRINT "Command Syntax: ONLY1 D:\SUBDIR"
  8.    PRINT "       Returns: ErrorCode 1 if there's only one file"
  9.    PRINT "   Environment: ONLY1 contains the filename to process"
  10.    PRINT " Be sure to clear the when done."
  11.    END
  12. END IF
  13. PRINT "With regards, The Toolkit BBS 219-696-3415 HST"
  14.  
  15. f$ = COMMAND$ + "\*.*"
  16. PRINT "Checking Directory: "; f$
  17.  
  18. t$ = DIR$(f$)
  19. IF t$ > "" THEN 'at least one
  20.     t$ = "ONLY1=" + t$
  21.     IF LEN(DIR$) = 0 THEN
  22.         EnvOption 1     'manipulate parrent option
  23.         ENVIRON t$
  24.         PRINT "[ErrLvl 1] Setting Environ: "; t$
  25.         END 1
  26.     ELSE
  27.         'END 0
  28.     END IF
  29. ELSE            'no files
  30.    'END 0
  31. END IF
  32.  
  33.