 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
Q: $CURRENT(...)$ skipping text in quotes |
|
When executing the snippet:
 |
 |
(fun1($CURRENT(param2, names_only, escape_quotes)$) - fun2($CURRENT(param2, names_only, escape_quotes)$)
|
on text in the editor:
 |
 |
a.b c.d e.f 'g.h' 'i.j' 'k' 'l' 'm' 'n' snippet_triggered_here
|
, it will go all the way back to c.d to fetch params ending up in this:
 |
 |
a.b (fun1(c.d) - fun2(c.d) e.f 'g.h' 'i.j' 'k' 'l' 'm' 'n'
|
which is not exactly the result expected. Is this skipping of text in quotes by design?
|
|
Fri Sep 01, 2017 4:58 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
My understanding that the quoted text is treated as a string. In the parameters you got names_only, which instructs it to ignore strings and other similar things
|
|
Fri Sep 01, 2017 4:25 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
names_only is present so that I don't have to apply some pretty nasty checks to be able to manage both two- and one part names, because it recognizes and handles both a and a.b well. Without that I'd have to use params 1 through 6 instead of 1 and 2 just to check if param2 is . or not and repeat the same for the second argument as well, which would depend on the analysis of the first one. These would require some fairly complicated nested CASE WHENs I could easily avoid by using names_only. Omitting it from the snippet, while ultimately changing the end results, skips the literal string just the same.
For the record, I made a typo when posting the snippet code, the correct version is:
 |
 |
(fun1($CURRENT(param2, names_only, escape_quotes)$) - fun2($CURRENT(param1, names_only, escape_quotes)$)
|
yielding the result:
 |
 |
a.b (fun1(c.d) - fun2(e.f) 'g.h' 'i.j' 'k' 'l' 'm' 'n'
|
And this is what the results will look like when omitting names_only (and the logic that would otherwise handle two-part names):
 |
 |
a.b c.d e(fun1(.) - fun2(f) 'g.h' 'i.j' 'k' 'l' 'm' 'n'
|
|
|
Fri Sep 01, 2017 7:05 pm |
|
 |
|
|
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
|
|
|