Templates > Source Code (using TaggedValues) (#356)

I'm trying to access a specific class element tagged value.

Have tried the following but didn't return anything:

<%==SIM:ForEach:Element.TaggedValues==%><%==SIM:If:TaggedValue.Name=Parent==%>Property Parent<%==SIM:TaggedValue.Value==%> AS ci<%==SIM:TaggedValue.Value==%><%==SIM:EndIf==%><%==SIM:EndFor==%>

I couldn't find an example, do you have any suggestions on how to achieve this?

8 May 2014 3:35:11
Not Closed
Requested by
Win 7
Solved in

SJ 8 May 2014 4:56:21

I've noticed that there could be GetTaggedValue() but not sure of it's Syntax.

SJ 8 May 2014 6:16:46

Or should I be using Template Parameters for this purpose? Not sure how to use in a template.

Dusan Rodina - softwareideas.net 8 May 2014 7:14:26

The problem is in equal command, it should be 'Equals' instead of '='.

I corrected your code:

<%==SIM:ForEach:Element.TaggedValues==%><%==SIM:If:Equals(TaggedValue.Name,"Parent")==%>Property Parent<%==SIM:TaggedValue.Value==%> AS ci<%==SIM:TaggedValue.Value==%><%==SIM:EndIf==%><%==SIM:EndFor==%>

Here is the manual for the templates.


I will add the new articles about template language to Help section (www.softwareideas.net/en/help) soon.

SJ 8 May 2014 9:22:36

Thankyou for your super fast response. That worked a treat even though it is a bit long winded. Code generation is the main reason I purchased your software.

Thanks for the link above did end up finding it in a google search.

Looks like there is much more in the templates then documented.

Items of interest:

- Template Parameters how these are intended to be used

- Nested classes

- Include

I'm enjoying using your software, keep up the good work!!!

Dusan Rodina - softwareideas.net 11 May 2014 22:54:12

You're welcome!

Updated help for template language will be added soon to help section on this website.

Your Name:
You can use these formatting tags: [b]bold[/b] [i]italic[/i] [u]underline[/u] [url]www.example.com[/url] [code]some code[/code] [quote]quoted text[/quote] [list]one list item per line[/list]