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 


is this a bug or i'am doing something wrong?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Tue Feb 22, 2005 6:40 am    Post subject: is this a bug or i'am doing something wrong? Reply with quote

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 Smile
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 22, 2005 8:12 am    Post subject: Reply with quote

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

Code:
  if @both(%F,@ok())


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
View user's profile Send private message Visit poster's website MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Feb 22, 2005 8:15 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Tue Feb 22, 2005 5:45 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Feb 23, 2005 12:04 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Feb 23, 2005 4:18 am    Post subject: Reply with quote

ok cool could that cuase my problem? did i explain the problem well ?

thanks

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Feb 23, 2005 8:21 am    Post subject: Reply with quote

hi tim, i find your explanations very hard to follow - sorry Embarassed

i just looked at your code and tried to work out what you were trying to do and fixed what i thought needed fixing Smile

hope it helped

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Feb 23, 2005 3:35 pm    Post subject: Reply with quote

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 Sad
_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Feb 24, 2005 12:13 am    Post subject: Reply with 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?

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
View user's profile Send private message Visit poster's website MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Thu Feb 24, 2005 3:39 am    Post subject: Reply with quote

i can only add some many files then my listbox gets cleared all my it self i'am not sure why Sad

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 Sad

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Feb 24, 2005 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Feb 28, 2005 5:13 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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