Structure of user-defined em_commands

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
HalbschuhTouri
Junior Member
Junior Member
Posts: 64
Joined: 2023-01-20, 09:33 UTC

Structure of user-defined em_commands

Post by *HalbschuhTouri »

Perhaps a stupid question from a not so experienced em_commands user:

when defining a new em_command in "usercmd.ini" that is meant to consist of two or even multiple actions/cm_commands - what is the correct syntax to declare those?

It starts with the header
[em_Command_Name]
but following that can there be two or multiple lines starting with cmd=, like for example
cmd=action1
cmd=cm_command1
cmd=action2

and is there some "End_em_Command"-statement expected to finalize that "cmd=" list?

Or - is there only one single "cmd="-statement-line allowed where multiple action-commands have to be separated by a "comma" but need to appear within that single "cmd="-line, like for example
cmd=action1, cm_command1, action2
and if so - can there even be a "space" between the "comma" and the next action-command?

Thanks for your expertise in advance.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Structure of user-defined em_commands

Post by *Stefan2 »

only one single "cmd="-statement-line allowed
where multiple action-commands have to be separated by a "comma"
but need to appear within that single "cmd="-line, like for example
cmd=action1, cm_command1, action2
>> yes, that




We can create multiple user defined commands (UDC)
and call them altogether by another UDC:

[em_UDCa]
cmd=X
[em_UDCb]
cmd=Y
param=/b
em_UDCc]
cmd=Z

[em_myOwnCMD]
cmd=em_UDCa,em_UDCb,em_UDCc




can there even be a "space" between the "comma"
>> rather not, may work but not designed for that




We have tries to document that all together, see my sig
User avatar
Dalai
Power Member
Power Member
Posts: 9963
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Structure of user-defined em_commands

Post by *Dalai »

It might be easier to create user commands via TC's GUI, at least for the first commands and/or until you know their syntax within usercmd.ini. This can be done via cm_CommandBrowser.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Structure of user-defined em_commands

Post by *Stefan2 »

Dalai wrote: 2023-07-13, 19:35 UTC It might be easier to create user commands via TC's GUI, at least for the first commands and/or until you know their syntax within usercmd.ini. This can be done via cm_CommandBrowser.

Regards
Dalai


Right, use the GUI, next check the INI, go forward and back and learn that way how it works.
The GUI-way is explained there too >> https://ghisler.ch/board/viewtopic.php?p=344777#p344777





 
HalbschuhTouri
Junior Member
Junior Member
Posts: 64
Joined: 2023-01-20, 09:33 UTC

Re: Structure of user-defined em_commands

Post by *HalbschuhTouri »

Thanks guys, so
*********************************************
[em_CommandName]
cmd=action1,cm_command1,action2
*********************************************
(without the usual "space" between the "comma" and the beginning of the next action-statement/cm_/em_-command)
it is.
HalbschuhTouri
Junior Member
Junior Member
Posts: 64
Joined: 2023-01-20, 09:33 UTC

Re: Structure of user-defined em_commands

Post by *HalbschuhTouri »

Addendum:
In spite of my question having been answered I'm still wondering though. I've read your well-meant advice for beginners to create such multiple-action-em_commands via the GUI rather than adding them manually to "usercmd.ini" as long as one might be uncertain about the correct syntax.

So I've thought I should give this alternative method a try and then have a closer look at the syntax created automatically by the GUI. However I did not succeed as putting only one action-command in there was the easy - as well as trivial - part. But when I then tried to add a second or third action-command to that more complex em_command-structure as intended - all that happened was the GUI replacing the initial action-command by the new one instead of adding a second or third command to the structure.

I guess I could have foreseen that kind of behavior - but still, as it stands now, this GUI-method for beginners seems unfit to create those very composite-em_commands I intended to create in the first place and the uncertainty about how to do so correctly has been the root-cause for me to even start this thread. Anyhow due to the helpful advice here my problem of understanding has now been resolved and I've been able to create a working version of those composite-em_commands as desired - albeit only via the "direct-writing-method" requiring "expert-knowledge" about the correct syntax and (so far) not via the GUI as recommended.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Structure of user-defined em_commands

Post by *petermad »

2HalbschuhTouri

You should vote (make a reply showing support) for this suggestion then: https://ghisler.ch/board/viewtopic.php?t=79057
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
HalbschuhTouri
Junior Member
Junior Member
Posts: 64
Joined: 2023-01-20, 09:33 UTC

Re: Structure of user-defined em_commands

Post by *HalbschuhTouri »

petermad wrote: 2023-07-15, 10:54 UTC You should vote (make a reply showing support) for this suggestion then: https://ghisler.ch/board/viewtopic.php?t=79057
Done! Thank you for pointing out this already ongoing, related discussion.
Post Reply