Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2167
|
|
Macro combinations |
|
I'd like to create a snippet that has a $PROMPT$ macro with a default value that is a result of another ($$..$$ type) macro. Is it possible to create a working version of something like this?
 |
 |
$PROMPT(fk_table,Foreign key holder table,$$SELECT TOP 1 s.[name] FROM Mdbo.sysobjects s WHERE s.xtype = 'U' ORDER BY s.crdate DESC$$)$
|
May I suggest implementing $OBJECT1$ and $OBJECT2$ macros? They could be very powerful when combined...
|
|
Tue Aug 17, 2010 9:53 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7951
|
|
|
|
I tried that and other variants and it seems to me it is not currently possible to feed results of code execution to the following or nested $PROMPT$ macro. That macro seems to be parsed and processed before the code run.
My conclusion is that nested $$.$$ or $..$ macros are not supported.
|
|
Tue Aug 17, 2010 2:37 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2167
|
|
|
|
$.$ macros can be easily nested inside $$.$$ ones. The only complex $.$ macro is PROMPT, but if you failed at it too, I won't experiment anymore with them.
That's a pity :( I wanted to create a series of PROMPT using snippets that could supply their defaults or a list of options that depend on table data. Would you consider that feature in a future version (if it's not too difficult to implement, of course)?
|
|
Tue Aug 17, 2010 3:47 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7951
|
|
|
|
Thank you for your suggestions. I'm going to submit an enhancement request for that. I just don't know whether this can be done or not, I'm not sure if there are presently any technical limitations for nested macros
|
|
Tue Aug 17, 2010 5:58 pm |
|
 |
|