*FREE* code!

 BBS: Inland Empire Archive
Date: 02-10-93 (22:31)             Number: 373
From: SCOTT DRYSDALE               Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: *FREE* code!                   Conf: (2) Quik_Bas

  Zack Jones said he wanted some code a boot'n through this
echo so here's something you might (or might not) want to
clip...  I made this programme (took only a half hour or
so) when noticing that QB's Mkdir command only supported
one extra directory at a time, and I wanted to add a chain
of directorys.... anyways here it goes.

===\ clip here /===

DECLARE SUB md (drive$, directory$)

SUB md (drive$, directory$)
IF drive$ = "" THEN drive$ = "C:"

        a = INSTR(1, directory$, "\")
        b = INSTR(a + 1, directory$, "\") - (a + 1)
        WHILE INSTR(a + 1, directory$, "\") <> 0
                direct$ = MID$(directory$, a + 1, b)
                SHELL "MD " + drive$ + LEFT$(directory$, a) + direct$
                a = INSTR(a + 1, directory$, "\")
                b = INSTR(a + 1, directory$, "\") - (a + 1)

        direct$ = MID$(directory$, a + 1, LEN(directory$) - a)
        SHELL "MD " + drive$ + LEFT$(directory$, a) + direct$


===/ End of clip \===

An example of usage might be "call md ("C:",
"\BACKUP\EXTRA\SPARE\GAME")" when only "C:\backup" exists...

Well?   It's short but sweet.... personnally I use the same
thing but I've added MKDIR instead of "SHELL" but in order
to do so you must have some worthy error handling... that
there works just fine.  Have a blast.

--- Maximus 2.01wb
 * Origin: Terminal Velocity Kingston *CANADA* (613)542-4613/6594, (1:249/128)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET