forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Create directory with sub directories

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue May 14, 2002 7:37 pm    Post subject: Create directory with sub directories Reply with quote

Here is a snip that I posted on the old board to create
a directory with sub directories. If the directory is
NOT created successfully %%direrror is set to 1.

Code:

  rem -- All you need to do is set the Variable %%InstallDir
  rem -- to a path [%%installDir = C:\Program Files\MyProg\Bitmaps\Sunsets]
  rem -- Then call CreatDir as a sub
:CreateDir
  %%len = @len(%%InstallDir)
  list create,15
  repeat
    %%pos = @pos("\",%%InstallDir)
    if @greater(%%pos,0)
      %%seg = @substr(%%InstallDir,1,@pred(%%pos))
      list add,15,%%seg
      %%installdir = @substr(%%InstallDir,@succ(%%pos),%%len)
      %%len = @len(%%InstallDir)
    else
      list add,15,%%InstallDir
    end
  until @equal(%%pos,0)
  %%drive = @item(15,0)
  list seek,15,0
  list delete,15
  %%cnt = @count(15)
  %%x = 0
  repeat
    if @item(15,%%x)
      if %%tdir
        %%tdir = %%tdir"\"@item(15,%%x)
        if @not(@file(%%tdir,D))
          directory create,%%tdir
          if @not(@ok())
            %%direrror = 1
          end
        end
      else
        %%tdir = %%drive"\"@item(15,%%x)
        if @not(@file(%%tdir,D))
          directory create,%%tdir
          if @not(@ok())
            %%direrror = 1
          end
        end
      end
    end
    %%x = @succ(%%x)
  until @equal(%%x,%%cnt)
  %%tdir =
  list close,15
  exit

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group