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 


list add question

 
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: Mon Feb 21, 2005 8:19 pm    Post subject: list add question Reply with quote

hello all

i'am having troubles trying to get list add to work the way i need it

here is my code i have

Code:

DIALOG CREATE,New Dialog,-1,0,240,160
REM *** Modified by Dialog Designer on 2/21/05 - 13:55 ***
 rem  DIALOG SHOW


%%Fest = @filedlg("All Files (*.*)|*.*",Add File,c:\whatever\*.*,MULTI)
LIST CREATE,1
  LIST ASSIGN,1,%%fest
    list add,1,Source: "%%fest"; DestDir: "C:\whatever\test"; Flags: ignoreversion
 LIST SAVEFILE,1,C:\test\test\test.txt
  info %%fest



probelm is when i save it it does this


C:\test\test\readme.txt
C:\test\test\help.txt
C:\test\test\test.exe
Source: %%fest; DestDir: C:\whatever\test; Flags: ignoreversion

i need it to do this:

Source: "C:\test\test\test.exe"; DestDir: "C:\whatever\test"; Flags: ignoreversion

Source: "C:\test\test\help.txt"; DestDir: "C:\whatever\test"; Flags: ignoreversion

Source: "C:\test\test\test.exe"; DestDir: "C:\whatever\test"; Flags: ignoreversion

how do i get it to save it like this? NOTE the "" if i added the "" to the list add fuction vds Ignores it Sad


thanks

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


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Feb 21, 2005 8:49 pm    Post subject: Reply with quote

Code:

  %%Fest = @filedlg("All Files (*.*)|*.*",Add File,c:\whatever\*.*,MULTI)
  if @null(%%Fest)
    goto Evloop

  LIST CREATE,1
  list create,2
  LIST ASSIGN,1,%%fest
  %x = 0
  repeat
    list add,2,Source: @chr(34)@item(1,%x)@chr(34); DestDir: @chr(34)C:\whatever\test@chr(34); Flags: ignoreversion
    %x = @succ(%x)
  until @equal(%x,@count(1))
 
  LIST SAVEFILE,2,C:\test\test\test.txt
  info @text(2)

  list close,1
  list close,2
  goto Evloop



How's that Question

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Feb 21, 2005 9:33 pm    Post subject: Reply with quote

wow that worked good

one question tho

Code:

%%Fest = @filedlg("All Files (*.*)|*.*",Add File,c:\whatever\*.*,MULTI)



i'am trying to get the path out of %%fest i have tried this

%T = @path(%%fest)

but this list all the files with it Sad

i need just the folder name into a varible if ya follow what i mean

thanks

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


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Feb 21, 2005 9:49 pm    Post subject: Reply with quote

Try this:
Code:


  %%fest = @filedlg(...)
  if @null(%%fest)
    goto Evloop

  list create,1
  list create,2
  list assign,1,%%fest

  rem How many items choosen
  if @equal(@count(1),1)
    rem Only 1, so we just get the path from %%fest
    %%filePath = @path(%%fest)
  else
    rem Otherwise, you can use @path() on any item in list 1, to get the
    rem path of the choosen files.
    %%filePath = @path(@item(1,0))
  end

  rem then do the other stuff here


_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Tue Feb 22, 2005 3:56 am    Post subject: Reply with quote

that code does work good but i need to strip the \ at the end of the @path()

any ideas Smile


thanks for all the help

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Tue Feb 22, 2005 5:50 am    Post subject: Reply with quote

How about...

Code:

%%filepath = @strdel(%%filepath,@len(%%filepath))


Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Tue Feb 22, 2005 6:41 am    Post subject: Reply with quote

i will give that a try

thanks

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


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Feb 22, 2005 1:31 pm    Post subject: Reply with quote

Hooligan wrote:

Code:

%%filepath = @strdel(%%filepath,@len(%%filepath))



This also works :
Code:

%%filePath = @substr(%%filePath,1,-1)

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Tue Feb 22, 2005 3:57 pm    Post subject: Reply with quote

Bweckel wrote:
Quote:

%%filePath = @substr(%%filePath,1,-1)


...with less typing!
Good one!

Hooligan

_________________
Hooligan

Why be normal?
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