SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
$CURRENT()$ macro anomaly

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
$CURRENT()$ macro anomaly
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post $CURRENT()$ macro anomaly Reply with quote
$CURRENT()$ macro has a minor glitch when Escape quotes is used. In case the last character in the selection is a quote, it won't be escaped. Also, there were new parameters (Parameter1, ..., Paramater 9) introduced in the macro and I cannot find them in the help. What is their purpose?
Sun Nov 04, 2012 1:44 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
Thank you for pointing this out. Indeed this change has been omitted in the product documentation.

Here is what I have found in the internal documents.
$CURRENT(...)$ allows additional behavior modifiers, for example, $CURRENT(selection,escape_quotes)$


There are 3 possible cases of snippet code execution:
1. special shortcut, for example, Alt+0.
2. selecting menu item in a popup menu
3. entering snippet caption + shortcut(for example, Ctrl+Enter) or selection in a popup menu.

$CURRENT...$ macros are usable mostly in cases #1 and #2. In case #3 the current word and the current name return snippet caption, the current selection returns empty string (no selection while still entering text), the current line returns the string containing snippet caption.

New parameters "param1", ...,"param9" are intended for use with the case #3. Param1 returns token before snippet caption, param2 - before param1, and so on, going backward.

All that is implemented to extend the existing functionality available in versions before 6.3. All previous snippets $CURRENT_WORD$... etc.. should continue working as before, for example, $CURRENT_WORD$ is identical to $CURRENT(word)$

parameter name modifiers for $CURRENT(…)$ macro

word - current word
name - current name
line - current line
selection - current selection
param# - token with offset #
escape_quotes - escapes quotes in the resulting string


Last edited by SysOp on Mon Nov 05, 2012 6:47 pm; edited 1 time in total
Mon Nov 05, 2012 11:28 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post Reply with quote
I'm extensively using snippets, invoking them mostly by #1 or #3. Escaping quotes was something I missed dearly and I'm glad you implemented that feature. param# is very innovative, though I cannot think of a situation I could use it. Could you share some examples, please?
Mon Nov 05, 2012 3:14 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
Here is something else I found in the internal documents

In the snippet named TEST

1: $CURRENT(param2)$
2: $CURRENT(param1)$

code in the editor:

"word1 && spaces" word2 TEST[Ctrl+Enter to execute snippet]

Result:

1: word1 && spaces
2: word2


I'm really unsure about the usability of this one. It doesn't seem to work without typing snippet name TEST in the editor and invoking the same snippet from context menu


Last edited by SysOp on Tue Nov 06, 2012 12:06 pm; edited 1 time in total
Mon Nov 05, 2012 7:09 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post Reply with quote
Interesting. I made an exchanger (exchanges the two last words preceding the snippet trigger word). But I don't think I'll use it frequently. Nevertheless, this feature might come in handy one day.
Tue Nov 06, 2012 4:36 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2102

Post Re: $CURRENT()$ macro anomaly Reply with quote
gemisigo wrote:
$CURRENT()$ macro has a minor glitch when Escape quotes is used. In case the last character in the selection is a quote, it won't be escaped.


Still an issue in 6.4.199 preview.
Wed May 22, 2013 3:49 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
Thank you. I have reported this issue to the development team.
Wed May 22, 2013 8:33 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.