 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[SA 7.5.501 Pro] - $CURRENT(param1)$. How does it work? |
|
How do CURRENT macros with params work? Is there a predefined list of separators for the parameters? Could they be overridden or changed?
|
|
Wed May 04, 2016 4:15 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
It doesn't appear to be documented in the User's Guide. But I found some tips here http://www.softtreetech.com/support/phpBB2/viewtopic.php?t=23790&highlight=current+param2
So they refer to tokens (same as words) in the text. By word we mean a series of text characters separated by white spaces and/or non alphanumeric characters with an exception of a series of characters enclosed in double quotes. For example,
 |
 |
"word1 && spaces" word2,word3 _word4_ |
The above contains four logical tokens
word1 && spaces
word2
word3
_word4_
|
|
Thu May 05, 2016 1:07 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Thanks, that clears it up a bit. I also made some experiments and it turned out that period is handled as a token, brackets are seen as separators, but anything between parentheses vanishes, that is, using
 |
 |
[$CURRENT(param4)$] [$CURRENT(param3)$] [$CURRENT(param2)$] [$CURRENT(param1)$]
|
as snippet
and
 |
 |
a.b
a..b
funct(arg)
funct[param]
|
as code
will end up as
 |
 |
[] [a] [.] [b]
[a] [.] [.] [b]
[] [] [] [funct]
[] [] [funct] [param]
|
This is fine, and could be used to "dismantle" but it also restricts its use quite a bit.
May I request a feature enhancement?
If there were options (like Escape quotes) to the CURRENT macro in case Parameter x is used that would allow periods and parentheses to be handled as part of the word, it would widen the versatility of this macro. Right now, if I want to pass objects as parameters I either have to guess if it's going to be multi-parted and create the snippet prepared to that (resulting in those hard-to-edit-later snippets) or put the multi-parted object into double quotes. On the other hand, if its behavior could be consequently altered to handle objects as words and not drop things in parentheses, thus dropping the surplus double quotes instead, I already see about half a dozen snippets where this could be used efficiently...
|
|
Thu May 05, 2016 3:50 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I have submitted that as a new enhancement request. Thank you.
|
|
Thu May 05, 2016 9:37 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|