TDL - If StringValueEquals CustomPropertyName

Posts   
 
    
BertS
User
Posts: 89
Joined: 28-Jul-2005
# Posted on: 12-Aug-2005 11:51:10   

Hi,

I want to use a customproperty that is used in most (but not all) entities. If this customproperty is available, I want to add a public property to the entityBase.

I want to use this code:

<[Foreach CustomProperty Entity]><[If StringValueEquals CustomPropertyName "MyProp"]>
''' some lines of code
<[EndIf]><[NextForeach]>

The problem is that this doesn't work, because CustomProperty cannot be used together with StringValueEquals, like specified in the SDK.

What's the right way to implement this?

Edit: I see it's the same question as this: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=2675, is the option already added? (i'm using Template Studio v1.1.06212005 Final) And to give an answer to your question "Do you have more things you'd like to add to that if statement, so I can add them all at once": at least all things that can be looped using Foreach simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 12-Aug-2005 20:33:40   

BertS wrote:

Hi,

I want to use a customproperty that is used in most (but not all) entities. If this customproperty is available, I want to add a public property to the entityBase.

I want to use this code:

<[Foreach CustomProperty Entity]><[If StringValueEquals CustomPropertyName "MyProp"]>
''' some lines of code
<[EndIf]><[NextForeach]>

The problem is that this doesn't work, because CustomProperty cannot be used together with StringValueEquals, like specified in the SDK.

What's the right way to implement this?

At the moment it's not possible. It's being added in 1.0.2005.1.

Edit: I see it's the same question as this: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=2675, is the option already added? (i'm using Template Studio v1.1.06212005 Final) And to give an answer to your question "Do you have more things you'd like to add to that if statement, so I can add them all at once": at least all things that can be looped using Foreach simple_smile

simple_smile One thing that's planned to be added in 1.0.2005.1 is that you can use .lpt templates as include templates inside TDL templates. This will make it possible to add your own code by writing a simple C# template, which is more flexible than the TDL language and which will offer you the ability to traverse every object in the project graph. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
BertS
User
Posts: 89
Joined: 28-Jul-2005
# Posted on: 15-Aug-2005 08:41:59   

ok, thank you for the information.