A TC ButtonBar Icon Parameters problem [with CopyToTabs]

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

eitang
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

A TC ButtonBar Icon Parameters problem [with CopyToTabs]

Post by *eitang »

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,
Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

<removed>
Last edited by Samuel on 2009-07-31, 18:37 UTC, edited 2 times in total.
eitang
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

Post by *eitang »

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:

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.
*
*
*
Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Sorry please ignore last post. I was completely wrong.

Here I get every file quoted if it contains spaces and every other file unquoted. (PB8)
eitang
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

Post by *eitang »

I thought this may be a setting in TC. Because reverting back to PB7 did not change anything, I thought it might reside in WinCmd.ini, but where?
Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

AFAIK there is not.

What do you get using:

Code: Select all

?%T%M %P%S
And what do you expect?

Could you give an example?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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.
Author of Total Commander
https://www.ghisler.com
eitang
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

Post by *eitang »

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:

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\

Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Perhaps using the following as command:

Code: Select all

"D:\TC Ultima Prime\EG_CopyToTabs\CopyToTabs.exe"
(quoted command) will fix it.

Perhaps TCUP is the bug. ;-)
eitang
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

Post by *eitang »

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.
Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Have you tried an empty ini?

Here I have no problems using

Code: Select all

%T%M %P%S
with an dummy ahk.

You didnt tried this suggestion of me:

Code: Select all

?%T%M %P%S
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?
eitang
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

Post by *eitang »

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...
Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
eitang
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

Post by *eitang »

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...
Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

eitang wrote:
Samuel wrote: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
I meant the current developed version of your program not from TC, but you answered that it didn't change.


eitang wrote:
ghisler(Author) wrote:%T%R (Target path+Target selected files)
Thanks. Works as expected. and I'll adopt it.
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:As I said several times in this thread, my CopytoTabs.exe works on 2 other computers faultlessly.
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:Samuel: I tried ? and it works well Thank you very much. I wish I knew it before I started to restore my PC...
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
Senior Member
Senior Member
Posts: 250
Joined: 2003-05-19, 20:08 UTC
Location: France
Contact:

Post by *eitang »

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...
Best Wishes,

Eitan Gilboa (License #: 17011)
URL: https://eitang.pagesperso-orange.fr/
Post Reply