SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 7.5.501 Pro] - $CURRENT(param1)$. How does it work?

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 7.5.501 Pro] - $CURRENT(param1)$. How does it work?
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post [SA 7.5.501 Pro] - $CURRENT(param1)$. How does it work? Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
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,

Code:
"word1 && spaces" word2,word3      _word4_



The above contains four logical tokens
    word1 && spaces
    word2
    word3
    _word4_

Thu May 05, 2016 1:07 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post Reply with quote
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
Code:

[$CURRENT(param4)$] [$CURRENT(param3)$] [$CURRENT(param2)$] [$CURRENT(param1)$]
as snippet
and
Code:

a.b
a..b
funct(arg)
funct[param]
as code
will end up as
Code:

[] [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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
I have submitted that as a new enhancement request. Thank you.
Thu May 05, 2016 9:37 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.