 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[ES] - Dynamic variable values in PROMPT macro |
|
Any chance you plan to extend the snippet PROMPT macro with the same power-variables the Code Generators are already using?
It would make snippets able to dynamically generate the possible value(s) (both Data and Display) for both Enter and Select value from drop-down list Input Types. SA with snippets is already the database tool equivalent of Victorinox Swiss Champ XLT, but having dynamic values to choose from could raise it to a whole new level of crazy.
By the way, I haven't found any traces of those variables for Code Generators in the User Guide. Where did you hide them in there?
|
|
Mon Aug 30, 2021 1:41 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
In the Code Generator you define the variables. There is Variables section available for each template. You can use [+] icon to add new, and then give it a name and provide a query returning values required for the template. To enter a query, expand Values property on the right. As an example please refer to predefined variables.
Please mouse over property names in the Options for additional hints and details.
The snippet's $prompt$ macro supports drop-down lists too but as of now it supports static user defined lists only, while the other one supports both static and dynamic query based lists.
|
|
Mon Aug 30, 2021 4:09 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
To avoid any misunderstanding, this is primarily an enhancement suggestion. I'm aware of the snippet prompt limitations. The 'By the way' question was just an afterthought, after not finding anything about this feature in the User Guide. I just checked to see if it has any further hidden gems. It would be awesome if plain snippets had this feature (advanced variables).
|
|
Mon Aug 30, 2021 4:56 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I will submit an enhancement request to support using SQL queries to as a source of list values. I guess for everything else $$..$$ macro should be sufficient. Right?
|
|
Mon Aug 30, 2021 5:52 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
 |
 |
I will submit an enhancement request to support using SQL queries to as a source of list values. I guess for everything else $$..$$ macro should be sufficient. Right? |
Thank you very much. Quite right, the $$...$$ is another powerful feature I'm utilizing the hell out of. I'm also stretching its limits to the breaking point. I tried to mix it with the PROMPT macro but as both are delimited with $s that didn't work out well. And then there's the question of which one came first the chicken or the egg, that is, the prompt or the $$...$$ macro. What if the code in $$...$$ would use a variable created by a PROMPT macro? Or vice versa. But then you revealed that PROMPT macros are executed first and all that tinkering with PROMPT + $$...$$ became irrelevant.
Now, that I started thinking about it again if instead of always running the PROMPT first you had a method that could figure out the sequence of interdependent PROMPTs and $$...$$ should run, this could be implemented relatively easy. Provided that there are no circular references. Also, "relatively" is a very strong euphemism here, of course.
|
|
Tue Aug 31, 2021 8:57 am |
|
 |
|
|
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
|
|
|