Passing parameters to a program

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 09-03-2003 14:29:33 +0000 TucknDar wrote:

T> Black Dog: why do you always use another font than
T> the rest?


I'm sorry to say it, but it is definitely not your business, buddy, with all my respect. Or should I say it another way?[/face]
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

I *thought* I was finished

Post by *robinsiebler »

I got ExamDiff to work, and I thought all was well. Then today I tried to open one file from each pane in ConText and found that didn't work. I've tried several different commands, but nothing has worked. This:

Code: Select all

C:\Program Files\wincmd\Plugins\lst2mlt.exe
/X:"c:\Program Files\ConTEXT\ConTEXT.exe /i" /L:%L
works fine if both files are in the same pane. Lst2str doesn't work even if both files are in the same pane. Lst2mlt doesn't have all of the options available to lst2str, which may be the problem. :?:
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

You aren't using it correctly. What you should do is the following:
C:\Program Files\wincmd\Plugins\lst2str.exe
/X:"c:\Program Files\ConTEXT\ConTEXT.exe" /L:%L /F:%T%M /S:"/i"

This would call the selected exe with all the files from the Source Pane and another file from the Target Pane, if this program should only receive 2 files state the /N:2 parameter.

Please read the readme.txt, that is what it's for. Note the /F:%T%M this tells TC to put the file from the Target Pane also, please also check the /N: from the readme it will help you in some cases. lst2str should work, please note that the /i switch should be in the SWITCHES section and not the executable name. READ the readme.txt for correct usage.

Cheers.
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Bug?

Post by *robinsiebler »

I don't know if this is the expected behavior, but it is definitely what I expected or desired!

Here is the string that I am passing to lst2str:
/X:"c:\Program Files\ConTEXT\ConTEXT.exe" /L:%L /F:%T%M /S:"/i"

Here is the behavior that I am seeing:

If I have 3 files selected in the right (non-active) pane and 1 file selected in the left (active) pane, when I invoke ConText, the selected file in the left pane and the highlighted file in the right pane are loaded.

If I have 3 files selected in the left (non-active) pane and 1 file selected in the right (active) pane, when I invoke ConText, the selected file and the highlighted file in the right pane and the 1st selected file and the highlighted file in the left pane are loaded.

If I have 1 file selected in each pane and the left pane is active: the selected file in the left pane and the highlighted file in the right pane are loaded. The same is true for the right pane


What I expected was that *only* the files that I selected would be passed to Context. Having different files loaded depending on which pane is active is not only strange, but annoying! Especially if I have 3 files selected in one pane and a directory happens to be highlighted in the other because then I get an error message when the editor tries to open it!

:evil:
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

The problem is with TC, when you put /F:%T%M TC always passes the file from the target pane even if it's not selected. My suggestion is don't use this parameter unless you really need it (like examdiff) and then specify /N parameter (read the readme about the behavior). In short it goes like this:
1. %L parameter is the files from the source pane i.e. the pane that is selected (it doesn't matter if it's left or right).
2. %T%M is a file from the target pane even if it's not selected (it's the file to which cursor moves when you press TAB).
3. /N:number limits the number of files opened to the number you specify, the priority is for %L that is if you specify /N:3, select 3 files in the source pane and there is %T%M parameter it will not be passed because %L as I said takes priority.

P.S. ALL your troubles would be over if you stop using %T%M (well not all... but at least those concerning lst2str)

Have fun.
Cheers.
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

Unfortunately, all of my troubles wouldn't be over. I guess maybe this is a TC bug, but still I want *only* the files that I have selected to be sent to ConText. Since I can't have them always be in only one pane, I would appear that I have to have have one button to call lst2str if the files are all in one pane and another for when they are in both panes.

Not an ideal solution.
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

I to was quite surprised at this behavior, you might want to send Christian a feature request or some such.


Cheers.
User avatar
sergeycentral
Junior Member
Junior Member
Posts: 34
Joined: 2003-07-24, 02:48 UTC
Location: USA

Post by *sergeycentral »

OK so I tired to make my editor (F4) to be:
"D:\Total Commander\lst2str.exe" /X:"D:\UltraEdit\uedit32.exe" /L:"%L" /W:M /N:100 /C:4096 /E

What this is supposed to do is open my selected files with UltraEdit when I press F4.

So it is true, %L can't be used to pass stuff to the totalcmd's command line

I tried doing this, from the command line, and it worked :shock: :
"D:\Total Commander\lst2str.exe" /X:"D:\UltraEdit\uedit32.exe" /L:"D:\Total Commander\tcSettings.list" /W:M /C:1024

So, pretty much %L doens't work. AND either I have to find another way to do this OR wait for TC 6.0 and hope that %L thing will work :idea: .

Any suggestions?
User avatar
sergeycentral
Junior Member
Junior Member
Posts: 34
Joined: 2003-07-24, 02:48 UTC
Location: USA

Post by *sergeycentral »

I tried something like this, but didn't go all the way.

I could possible do something like this in wimcmd.ini:
[user]
menu7=Online Forum...
cmd7=D:\Total Commander\lst2str.exe
param7=/X:"D:\UltraEdit\uedit32.exe" /L:"%L" /W:M /N:100 /C:4096 /E
[Shortcuts]
F4=cm_usermenu7

I know cm_usermenu7 would work. But is it possible to do:
[Shortcuts]
F4=whatever

???
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

"D:\Total Commander\lst2str.exe" /X:"D:\UltraEdit\uedit32.exe" /L:"%L" /W:M /N:100 /C:4096 /E
....
So, pretty much %L doens't work. AND either I have to find another way to do this OR wait for TC 6.0 and hope that %L thing will work.
Well %L or any other such parameter won't work in defining your editor, but %L does work where it's supposed to.

But you could do the following:

[User]
menu7=some_name
cmd6=C:\Program Files\Wincmd\Plugins\lst2str.exe
param6=/X:"C:\Program Files\UltraEdit\UEDIT32.EXE" /L:"%L" /W:M /N:100 /C:4096 /E

and then define a shortcut for this menu
[Shortcuts]
A+4=cm_UserMenu7

this would work, by pressing ALT+4; or define whatever shortcut you like.

Cheers.
Post Reply