| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 22, 2005 6:40 am Post subject: is this a bug or i'am doing something wrong? |
|
|
hello all
when i uses @filedlg and i selected alot of files that are in sub folders,etc all of a sudden it clears it then its just shows what i just selected..hard to explain so i hope i explain this well
here is what i have
| Code: |
%F = @filedlg("All Files (*.*)|*.*",Add File,c:\test\*.*,MULTI)
LIST ASSIGN,listbox1,%f
if @both(@file(%F),@ok())
if @not(@equal(@pos(c:\test\,%f),0))
else
info Folder is not under c:\test
list clear,ListBox1,
list add,ListBox1,move program folder to c:\test then try again!
dialog disable,CreateC
dialog disable,add
dialog disable,button5
goto evloop
|
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 22, 2005 8:12 am Post subject: |
|
|
hey tim,
i don't think i understand what you are saying but i think you should not use
| Code: | | if @both(@file(%F),@ok()) |
but i suggest you use
as i don't think that you are using @FILE() properly there
you basically want to know if the user has selected 1 or more files and using my suggestion will do that for you
serge _________________
|
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Feb 22, 2005 8:15 am Post subject: |
|
|
you also have END's missing
| Code: |
%F = @filedlg("All Files (*.*)|*.*",Add File,c:\test\*.*,MULTI)
LIST ASSIGN,listbox1,%f
if @both(@file(%F),@ok())
if @not(@equal(@pos(c:\test\,%f),0))
else
info Folder is not under c:\test
list clear,ListBox1,
list add,ListBox1,move program folder to c:\test then try again!
dialog disable,CreateC
dialog disable,add
dialog disable,button5
end
end
goto evloop |
serge _________________
|
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 22, 2005 5:45 pm Post subject: |
|
|
ok i will check that out to try to explain more make a dialog and add a list elemet called listbox1 then add a button called addfiles then make a button labe for that button and put my code in there...then start to add alot of files that are in a folder.then selected some files that are in a sub folder..you will see what i mean
i hope this explain it better
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Feb 23, 2005 12:04 am Post subject: |
|
|
hey tim,
i can see another problem in your code - keep in mind that %f will contain a "list" of items and therefore should not be treated as a text variable if you know what i mean...
consequently,
| Code: | | if @not(@equal(@pos(c:\test\,%f),0)) |
does not make much sense as you are treating %f as a 1 line text variable which it is not if you are selecting several files at a time
you will need to go through the list to check each item to see if it contains the path you require
| Code: | %F = @filedlg("All Files (*.*)|*.*",Add File,c:\test\*.*,MULTI)
if @both(%F,@ok())
%%warn = no
LIST ASSIGN,listbox1,%f
%i = 0
repeat
list seek, listbox1, %i
if @not(@equal(@pos(c:\test\,@item(listbox1)),0))
%%warn = yes
end
%i = @succ(%i)
until @equal(%i,@count(listbox1))@equal(%%warn,yes)
if @equal(%%warn,yes)
info Folder is not under c:\test
list clear,ListBox1,
list add,ListBox1,move program folder to c:\test then try again!
dialog disable,CreateC
dialog disable,add
dialog disable,button5
end
end
goto evloop
|
serge _________________
|
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Feb 23, 2005 4:18 am Post subject: |
|
|
ok cool could that cuase my problem? did i explain the problem well ?
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Feb 23, 2005 8:21 am Post subject: |
|
|
hi tim, i find your explanations very hard to follow - sorry
i just looked at your code and tried to work out what you were trying to do and fixed what i thought needed fixing
hope it helped
serge _________________
|
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Feb 23, 2005 3:35 pm Post subject: |
|
|
i can only add so many files before my list gets cleared..this is what i'am trying to say...i don't know why this is happing  _________________ Have a nice day  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Feb 24, 2005 12:13 am Post subject: |
|
|
are you saying that you cannot add to listbox1 the contents of %f while keeping the current contents of listbox1? in other words, you want to append listbox1 with %f but it does not work?
or are you saying that using %f, you can only add a certain number of files to listbox1, in one go?
serge _________________
|
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Thu Feb 24, 2005 3:39 am Post subject: |
|
|
i can only add some many files then my listbox gets cleared all my it self i'am not sure why
| Quote: |
are you saying that you cannot add to listbox1 the contents of %f while keeping the current contents of listbox1? in other words, you want to append listbox1 with %f but it does not work?
|
what you said is what its doing....i can only add so many the the list gets clear  _________________ Have a nice day  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Feb 24, 2005 8:50 am Post subject: |
|
|
the problem seems that LIST ASSIGN does not append but replaces the contents in listbox1, so . . .
| Code: | %F = @filedlg("All Files (*.*)|*.*",Add File,c:\test\*.*,MULTI)
list create, 1
list assign, 1, %f
list append, listbox1, 1
list close,1
if @both(@file(%F),@ok())
if @not(@equal(@pos(c:\test\,%f),0))
else
info Folder is not under c:\test
list clear,ListBox1,
list add,ListBox1,move program folder to c:\test then try again!
dialog disable,CreateC
dialog disable,add
dialog disable,button5
end
end
goto evloop |
serge _________________
|
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Feb 28, 2005 5:13 am Post subject: |
|
|
thanks all for the help
Serge - i will give that a try however what i did was to have it save to a file then read from the file...this seems to work but i will still try it out
thanks again _________________ Have a nice day  |
|
| Back to top |
|
 |
|
|
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
|
|