A TC ButtonBar Icon Parameters problem [with CopyToTabs]
Moderators: Hacker, petermad, Stefan2, white
A TC ButtonBar Icon Parameters problem [with CopyToTabs]
I wrote this TOOL:
http://www.ghisler.ch/board/viewtopic.php?t=23274&sid=db286221bc9d48f8764505d12856011d
Here is the link:
Download CopyToTabs
Part of the program is based on TC's ButtonBar's parameters. I used:
%T%M %P%S - A Single space between the two "couples".
The program worked well for two days, and now it seems that TC does not wrap the paths and filenames with " correctly...
I thought it was a B8 problem and exchanged all executable and dll files back to 7 but it behaves the same (wrong?) way.
I checked the ParamStr(i) and it really bahaves as if TC sends the parameters without quotes ".
Is there anything I can do?
Thanks a lot,
http://www.ghisler.ch/board/viewtopic.php?t=23274&sid=db286221bc9d48f8764505d12856011d
Here is the link:
Download CopyToTabs
Part of the program is based on TC's ButtonBar's parameters. I used:
%T%M %P%S - A Single space between the two "couples".
The program worked well for two days, and now it seems that TC does not wrap the paths and filenames with " correctly...
I thought it was a B8 problem and exchanged all executable and dll files back to 7 but it behaves the same (wrong?) way.
I checked the ParamStr(i) and it really bahaves as if TC sends the parameters without quotes ".
Is there anything I can do?
Thanks a lot,
Thank you, Samuel.
Of course, I did try all of those possibilities, all returned the error.
Furthermore, the parameters that worked are "documented" in the help, so it is not a matter of my memory <g>
The relevan Delphi 5 code, btw, if anybody wants to see it:
Of course, I did try all of those possibilities, all returned the error.
Furthermore, the parameters that worked are "documented" in the help, so it is not a matter of my memory <g>
The relevan Delphi 5 code, btw, if anybody wants to see it:
Code: Select all
Var
i : integer;
s, s1, s2 : String;
cr : string;
begin
cr := chr(13) + chr(10);
if paramcount > 2 then
begin
s := '';
s1 := ParamStr(1); // the TAB File in TARGET pane
Memo2.Lines.Clear;
s2 := s1; // for debugging
for i := 2 to paramcount do
begin
Memo2.Lines.add(paramstr(i)); // These ar the files in SOURCE pane
s := s + cr + paramstr(i); // Files List = Source files to copy
end;
s2 := s2+cr+s; // ALL of the collected parameters, for debugging
showmessage('ALL ParamStr(): ' + s2); // Debugging test
... and this is BAD.
*
*
*
- Samuel
- Power Member
- Posts: 1930
- Joined: 2003-08-29, 15:44 UTC
- Location: Germany, Brandenburg an der Havel
- Contact:
AFAIK there is not.
What do you get using:
And what do you expect?
Could you give an example?
What do you get using:
Code: Select all
?%T%M %P%S
Could you give an example?
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Indeed the following combinations should automatically be quoted if the path or name contains a space:
%P%N
%T%M
%P%S
and new in TC 7.5 Beta 8:
%T%R (Target path+Target selected files)
Please let me know if you encounter file names where this doesn't work.
%P%N
%T%M
%P%S
and new in TC 7.5 Beta 8:
%T%R (Target path+Target selected files)
Please let me know if you encounter file names where this doesn't work.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Samuel,
Thank you for your interest.
By now I tested the program on a different computer, with TC 7.04 and it worked perfectly !!! What can have happened ???
To answer your question:
Thank you for your interest.
By now I tested the program on a different computer, with TC 7.04 and it worked perfectly !!! What can have happened ???
To answer your question:
Code: Select all
ACTUAL PARAMETERS RESULT: (I separated the PARAMS -not the words- with LineFeeds)
-----
D:\TC
Ultima
Prime\EG_CopyToTabs\CopyToTabs.exe
D:\TC Ultima Prime\EG_CopyToTabs\SoftFromGrenoble.tab
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs_U.~pas
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs_U.~dfm
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs.~dsk
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs.~dpr
-----
******** comment ********
In the above you see that the ParamStr(0) , which should include the EXE path, i.e.
D:\TC Ultima Prime\EG_CopyToTabs\CopyToTabs.exe
Has been broken into the parts separated by space. ERROR.
In normal behaviour, I ignore ParamStr(0).
******* end comment *******
THE TAB FILE: D:\TC Ultima Prime\EG_CopyToTabs\SoftFromGrenoble.tab
(selected in target pane):
[activetabs]
0_path=d:\Delphi\Delphi 5\Depenses 2\Distrib\
1_path=F:\Depenses 2\
2_path=F:\Depenses 2\Distrib\
3_path=G:\Delphi\eitan\Delphi 5\Depenses 2\
4_path=G:\Delphi\eitan\Delphi 5\Depenses 2\Distrib\
5_path=h:\Delphi\eitan\Delphi 5\Depenses 2\
6_path=h:\Delphi\eitan\Delphi 5\Depenses 2\Distrib\
activetab=3
THE FILES TO COPY:
(selected in source pane):
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs_U.~pas
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs_U.~dfm
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs.~dsk
D:\Delphi\Delphi 5\EG_CopyToTabs\CopyToTabs.~dpr
I need The files above in the files pane of CopyToTabs, and the
FOLDERS inside the TAB file in the target dirs pane
d:\Delphi\Delphi 5\Depenses 2\Distrib\
F:\Depenses 2\
F:\Depenses 2\Distrib\
G:\Delphi\eitan\Delphi 5\Depenses 2\
G:\Delphi\eitan\Delphi 5\Depenses 2\Distrib\
h:\Delphi\eitan\Delphi 5\Depenses 2\
h:\Delphi\eitan\Delphi 5\Depenses 2\Distrib\
- Samuel
- Power Member
- Posts: 1930
- Joined: 2003-08-29, 15:44 UTC
- Location: Germany, Brandenburg an der Havel
- Contact:
Perhaps using the following as command:
(quoted command) will fix it.
Perhaps TCUP is the bug.
Code: Select all
"D:\TC Ultima Prime\EG_CopyToTabs\CopyToTabs.exe"
Perhaps TCUP is the bug.

Samuel,
Thank you again for your time.
>> "D:\TC Ultima Prime\EG_CopyToTabs\CopyToTabs.exe"
Thank you, but being a power member you certainly know that TC knows to wrap spaced commands with quotes: In this actual example:
"%commander_path%\EG_CopyToTabs\CopyToTabs.exe"
BTW, By now I've tested the program on another PC,this time with TC B8 and here too it performs perfectly... so the problem must be on the other pc, unfortunately.
Thank you again for your time.
>> "D:\TC Ultima Prime\EG_CopyToTabs\CopyToTabs.exe"
Thank you, but being a power member you certainly know that TC knows to wrap spaced commands with quotes: In this actual example:
"%commander_path%\EG_CopyToTabs\CopyToTabs.exe"
BTW, By now I've tested the program on another PC,this time with TC B8 and here too it performs perfectly... so the problem must be on the other pc, unfortunately.
- Samuel
- Power Member
- Posts: 1930
- Joined: 2003-08-29, 15:44 UTC
- Location: Germany, Brandenburg an der Havel
- Contact:
Have you tried an empty ini?
Here I have no problems using
with an dummy ahk.
You didnt tried this suggestion of me:
TC opens a window with the parameters it plans to send.
EDIT:
Did you tried the current developed version on other PCs? Or only old ones?
Can you revert your code?
Perhaps you added a wrong line? Do you have a version system?
Here I have no problems using
Code: Select all
%T%M %P%S
You didnt tried this suggestion of me:
Code: Select all
?%T%M %P%S
EDIT:
Did you tried the current developed version on other PCs? Or only old ones?
Can you revert your code?
Perhaps you added a wrong line? Do you have a version system?
Samuel,
hank you once more.
>> Have you tried an empty ini?
Yes, to no avail.
>> %T%M %P%S
This is what I use and it works on two oter PC's.
>> You didnt tried this suggestion of me:
>> ?%T%M %P%S
No, and it is VERY interesting.I saw it and thought it wasa typo on your part! Of course I must try that. Now that I know what it does...
>> Did you tried the current developed version on other PCs? Or only old ones?
TC B8 on one other PC - Works perfectly
and TC 7.04 on one other PC - Works perfectly
>> Can you revert your code?
It hasn't changed. I checked to make sure...
hank you once more.
>> Have you tried an empty ini?
Yes, to no avail.
>> %T%M %P%S
This is what I use and it works on two oter PC's.
>> You didnt tried this suggestion of me:
>> ?%T%M %P%S
No, and it is VERY interesting.I saw it and thought it wasa typo on your part! Of course I must try that. Now that I know what it does...
>> Did you tried the current developed version on other PCs? Or only old ones?
TC B8 on one other PC - Works perfectly
and TC 7.04 on one other PC - Works perfectly
>> Can you revert your code?
It hasn't changed. I checked to make sure...
Christian,
Thank you for popping in !!
>> %T%R (Target path+Target selected files)
Thanks. Works as expected. and I'll adopt it.
>> Please let me know if you encounter file names where this doesn't work.
if you mean %T%R I have nnot enough experience yet.
for %T%M %P%S It worked with the weirdest folder and name combinations...
As I said several times in this thread, my CopytoTabs.exe works on 2 other computers faultlessly.
I am in the process of restoring an full c: backup and will not be able to test anything on it before tomorrow...
Samuel: I tried ? and it works well Thank you very much. I wish I knew it beore I started to restore my PC...
Thank you for popping in !!
>> %T%R (Target path+Target selected files)
Thanks. Works as expected. and I'll adopt it.
>> Please let me know if you encounter file names where this doesn't work.
if you mean %T%R I have nnot enough experience yet.
for %T%M %P%S It worked with the weirdest folder and name combinations...
As I said several times in this thread, my CopytoTabs.exe works on 2 other computers faultlessly.
I am in the process of restoring an full c: backup and will not be able to test anything on it before tomorrow...
Samuel: I tried ? and it works well Thank you very much. I wish I knew it beore I started to restore my PC...
- Samuel
- Power Member
- Posts: 1930
- Joined: 2003-08-29, 15:44 UTC
- Location: Germany, Brandenburg an der Havel
- Contact:
I meant the current developed version of your program not from TC, but you answered that it didn't change.eitang wrote:TC B8 on one other PC - Works perfectlySamuel wrote:Did you tried the current developed version on other PCs? Or only old ones?
and TC 7.04 on one other PC - Works perfectly
Do you know what it does? IMO you should not adopt it. "%T%R" uses all Target files. "%T%M" uses just one file. (If you want to use all target files you have to use a divider parameter like "%T%R -D %P%S" in your script)eitang wrote:Thanks. Works as expected. and I'll adopt it.ghisler(Author) wrote:%T%R (Target path+Target selected files)
Obviously the folder "D:\TC Ultima Prime\EG_CopyToTabs" especially the TCUP is the problem. (The folder has spaces.) When you tried the other Computers did you tested it at the same folder? Or at least at another folder with spaces?eitang wrote:As I said several times in this thread, my CopytoTabs.exe works on 2 other computers faultlessly.
But its only meant for debug. It just debugs the actually used parameters. (see help on "?") - There should be no differences in the behavior of the program if you press just return.eitang wrote:Samuel: I tried ? and it works well Thank you very much. I wish I knew it before I started to restore my PC...
Samuel,
Sorry for the late reply... Restore took ages and this morning I did many tests before coming here. I'll first answer your Qs and then report new results:
>> Do you know what it does? IMO you should not adopt it.
[%T%R] Of course, Ch. Was very clear. I meant adopt it for other uses. Thanks.
>> use a divider parameter like "%T%R -D %P%S" in your script)
Ah! Another new concept for me... I'll check it. Thanks again.
>> Obviously the folder "D:\TC Ultima Prime\EG_CopyToTabs" ... (The folder has spaces.) When you tried the other Computers did you tested it at the same folder?
Identical structure... Absolutely.
Besides, I installd Beta8 in d:\TC7B8 this morning for testing. It worked the first time and then the bad behaviour appeared !!!
>> [the ?] But its only meant for debug.
It worked as expected, and incredibly, the parameters in the test box were always 100% correct! This means that it is my program that "corrupts" them, and it is NOT the case. A BIG Mystery.
This morning I unzipped my full \TC Ultima Prime from July 31st backup - -just before upgrading to Beta8- and updated the CopyToTabsEXE to the latest (this morning's, v3.9) version, and.... It works perfectly !!!
It is in a "\TC Ultima Prime OLD" directory; and beta 8 in "\TC Ultima Prime" on the same disk and does NOT work !!!
Those are this morning's test results. Weird ???
I am completely out of ideas... Maybe Christian will jump in again...
Sorry for the late reply... Restore took ages and this morning I did many tests before coming here. I'll first answer your Qs and then report new results:
>> Do you know what it does? IMO you should not adopt it.
[%T%R] Of course, Ch. Was very clear. I meant adopt it for other uses. Thanks.
>> use a divider parameter like "%T%R -D %P%S" in your script)
Ah! Another new concept for me... I'll check it. Thanks again.
>> Obviously the folder "D:\TC Ultima Prime\EG_CopyToTabs" ... (The folder has spaces.) When you tried the other Computers did you tested it at the same folder?
Identical structure... Absolutely.
Besides, I installd Beta8 in d:\TC7B8 this morning for testing. It worked the first time and then the bad behaviour appeared !!!
>> [the ?] But its only meant for debug.
It worked as expected, and incredibly, the parameters in the test box were always 100% correct! This means that it is my program that "corrupts" them, and it is NOT the case. A BIG Mystery.
This morning I unzipped my full \TC Ultima Prime from July 31st backup - -just before upgrading to Beta8- and updated the CopyToTabsEXE to the latest (this morning's, v3.9) version, and.... It works perfectly !!!
It is in a "\TC Ultima Prime OLD" directory; and beta 8 in "\TC Ultima Prime" on the same disk and does NOT work !!!
Those are this morning's test results. Weird ???
I am completely out of ideas... Maybe Christian will jump in again...