DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   Help with Browse (http://www.daniweb.com/forums/thread15562.html)

mex Dec 14th, 2004 12:25 pm
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

suRoot Dec 14th, 2004 1:59 pm
Re: Help with Browse
 
it's not "If Not" it's ELSE

You don't exit a for loop?

suRoot Dec 14th, 2004 2:04 pm
Re: Help with Browse
 
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

mnemtsas Dec 14th, 2004 6:26 pm
Re: Help with Browse
 
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".

mex Dec 15th, 2004 6:51 am
Re: Help with Browse
 
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 Dec 19th, 2004 4:43 am
Re: Help with Browse
 
well.... isn't there anyone left!! to help me

1o0oBhP Dec 19th, 2004 12:20 pm
Re: Help with Browse
 
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")


All times are GMT -4. The time now is 7:24 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC