SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Q: $CURRENT(...)$ skipping text in quotes

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Q: $CURRENT(...)$ skipping text in quotes
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post Q: $CURRENT(...)$ skipping text in quotes Reply with quote
When executing the snippet:
Code:

(fun1($CURRENT(param2, names_only, escape_quotes)$) - fun2($CURRENT(param2, names_only, escape_quotes)$)

on text in the editor:
Code:

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:
Code:

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


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

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

(fun1($CURRENT(param2, names_only, escape_quotes)$) - fun2($CURRENT(param1, names_only, escape_quotes)$)

yielding the result:
Code:

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):
Code:

a.b c.d e(fun1(.) - fun2(f) 'g.h' 'i.j' 'k' 'l' 'm' 'n'

Fri Sep 01, 2017 7:05 pm 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.