Skip to content

PropValue

Jip Claassens edited this page Jun 4, 2025 · 9 revisions

Miscellaneous functions PropValue

syntax

  • PropValue(item, property)

definition

PropValue(item, property) results in a string parameter with the value of the property argument for the item argument.

applies to

item can be any tree item, not being itself or one of it's subitems (an invalid recursion error is generated)

There is a list of all properties.

example

attribute<meter> A (ADomain) := B + C,  descr = "A is the sum of B and C";
{
   parameter<string> name       := PropValue(A, 'name');       // result = 'A'
   parameter<string> valuesunit := PropValue(A, 'ValuesUnit'); // result = 'meter'
   parameter<string> expr       := PropValue(A, 'expr');       // result = 'B + C'
   parameter<string> descr      := PropValue(A, 'descr);       // result = 'A is the sum of B and C'
}

This can be particularly convenient when decoupling data into a write and a read, especially when a complex storage name is configured.

unit<uint64> CALC := unique_uint64(OD_pair_rel)
, StorageName = "='%LocalDataProjDir%/Temp/'+LeftStr+RightStr+'.fss'"
{
	attribute<Euro>                 Price                       := Min_Index -> Price;
}

unit<uint64> Result
: StorageName = "=PropValue(CALC, 'StorageName')"
, StorageReadOnly = "true"
{
	attribute<Euro>                 Price;
}

see also

Clone this wiki locally