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


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Feb 21, 2005 8:19 pm Post subject: list add question |
|
|
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
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 21, 2005 8:49 pm Post subject: |
|
|
| 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  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Feb 21, 2005 9:33 pm Post subject: |
|
|
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
i need just the folder name into a varible if ya follow what i mean
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 21, 2005 9:49 pm Post subject: |
|
|
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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 22, 2005 3:56 am Post subject: |
|
|
that code does work good but i need to strip the \ at the end of the @path()
any ideas
thanks for all the help _________________ Have a nice day  |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Tue Feb 22, 2005 5:50 am Post subject: |
|
|
How about...
| Code: |
%%filepath = @strdel(%%filepath,@len(%%filepath))
|
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 22, 2005 6:41 am Post subject: |
|
|
i will give that a try
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Feb 22, 2005 1:31 pm Post subject: |
|
|
| 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 |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Tue Feb 22, 2005 3:57 pm Post subject: |
|
|
Bweckel wrote:
| Quote: |
%%filePath = @substr(%%filePath,1,-1)
|
...with less typing!
Good one!
Hooligan _________________ Hooligan
Why be normal? |
|
| 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
|
|