|
Post by George on Apr 22, 2022 15:57:01 GMT -5
Robert: The problem is that the substitution is done on the whole command line, before normal parsing occurs, so there is no %1 %2 etc. just sitting, waiting to be used. It would take a bit of work.
George
|
|
|
Post by George on Apr 23, 2022 11:37:59 GMT -5
Robert: No, I didn't give up, I made it work.
The positional parameters are simply =n, with n being 0 thru 9.
They cannot be used directly on the command line (it makes no sense) but can be used in the SET ALIAS. =0 is the command name, =1 is the 1st operand, etc.
They can not be concatenated; you can't say =1=2 or =1ABC=2, they must be stand-alone operands.
e.g. SET ALIAS.MYCMD = CHANGE =2 =1 ALL would give you a private CHANGE command that reverses the Find/Change operands.
Also, the SET command model must be complete, if any =n operands are detected, the result is solely based on that model, remaining unreferenced command line operands, not referenced by =n operands are discarded. I don't think this is a problem.
George
|
|
|
Post by George on Apr 23, 2022 13:24:57 GMT -5
Robert: SET ALIAS.ABC = FIND =1 ALL Command entered ABC STRING BBB CCC DDD Resulting command FIND STRING ALL <= The BBB CCC DDD were thrown away as no =n operand referenced them.
I'll look at removing the restriction on substitutions. The problem is going to be handling multiple = within a single 'word'
George
[UPDATE]
OK, =n can be embedded anywhere, the old =xxx full variables must still be separate operands (naturally).
BTW - what are you planning to use this for?
[/UPDATE]
|
|