|
-
Jan 10th, 2001, 01:17 AM
#1
Thread Starter
Junior Member
Is it possible to create a folder from vb?
When the user enters a folder name it must give the message
"does not exist and create one?"
-
Jan 10th, 2001, 02:39 AM
#2
Hyperactive Member
Hello ajitha again,
a Folder is a directory. To make a directory use:
MkDir("c:\YourDirectory")
Also handy: ChDir, CurDir & RmDir.
Nice regards,
Michelle.
-
Jan 10th, 2001, 03:11 AM
#3
Addicted Member
Here is a real basic way...
Code:
Dim MyDir As String
MyDir = "C:\GARBAGE"
If Dir(MyDir, vbDirectory) = "" Then
If MsgBox(MyDir & " don't exist, create?", vbYesNo + vbQuestion) = vbYes Then MkDir MyDir
Else
MsgBox MyDir & " already exists!", vbInformation
End If
-
Jan 10th, 2001, 07:59 AM
#4
Don't know why, but this is said to be a better and faster way to check if a folder/file exists or not.
Code:
Dim MyDir As String
MyDir = "C:\MyFolder"
If Len(Dir(MyDir, vbDirectory)) = 0 Then
If MsgBox(MyDir & " don't exist, create?", vbYesNo + vbQuestion) = vbYes Then MkDir MyDir
Else
MsgBox MyDir & " already exists!", vbInformation
End If
-
Jan 10th, 2001, 08:11 AM
#5
transcendental analytic
Well Matt, string comparation is slower than returning the size of a string Altough you wont win a **** by displaying a msgbox right after heh . Using Cbool() instead of comparing with 0 would be even faster though, you may win a nanosecond hehe
[Edited by kedaman on 01-10-2001 at 08:14 AM]
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|