954,559 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with Browse

I download a program located at ftp://ftp.softcircuits.com/vbsrc/browse.zip and being a newbie, i failed to make the code work. i mean to make my code work with yoursit... the code is given below:

Private Sub Command1_Click()

Dim myfile
Dim i As Integer

For i = 1 To 999
myfile = Dir("C:\" & i & ".bmp")
If Not myfile = i & ".bmp" Then
fSaveGuiToFile ("C:\" & i & ".bmp")
Exit For
End If
Next i

End Sub
I would like the user to choose the path like the one at ftp://ftp.softcircuits.com/vbsrc/browse.zip but failed to integrate this code of mine to work with it... could you please help me out. thanx

mex
Newbie Poster
5 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

it's not "If Not" it's ELSE

You don't exit a for loop?

suRoot
Posting Whiz in Training
210 posts since Apr 2004
Reputation Points: 38
Solved Threads: 9
 

it's probably best to put it into a sub ie


sub loop()
Dim myfile
Dim i As Integer

For i = 1 To 999
myfile = Dir("C:\" & i & ".bmp")
ELSE myfile = i & ".bmp" Then
fSaveGuiToFile ("C:\" & i & ".bmp")
End If
Next i
End Sub

suRoot
Posting Whiz in Training
210 posts since Apr 2004
Reputation Points: 38
Solved Threads: 9
 

fSaveGuiToFile

This function is not defined in the code anywhere.

By the way suRoot

If Not myfile = i & ".bmp" Then

is perfectly legitimate code. It's saying if filename myfile is not equal to i & ".bmp".

mnemtsas
Posting Whiz in Training
200 posts since Jul 2004
Reputation Points: 16
Solved Threads: 1
 

the code available for download is actually a script which allows user to choose the file location and shows the location in a text box! and my script which i posted is actually a part of my code which saves to C:\ when "command1" is pressed.

I would like to make it in such a way that it saves to the location specified by the user and not to C:\ which cannot be changed by the user! hope u understand.

thanx! hope to get the help from u again.

mex
Newbie Poster
5 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

well.... isn't there anyone left!! to help me

mex
Newbie Poster
5 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

not thought about using a common dialog control? aka CMDIALOG. If you want the user to specify something what about the inputbox function ie

Dim response
response = InputBox("Enter filename")
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You