question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked anthony.johnson answered

How to reference labels with globally defined names with the dot syntax

Hi,

Previously I have used label names defined in the global macros e.g.

#define LABEL_INPUT_DATA_ROW "Input data row"

to define a certain label name. Then I asserted the label and set the value to it and later on accessed the label with

getlabel(item, LABEL_INPUT_DATA_ROW);

This way I was sure to use the correct name of the label everywhere. If I would have manually entered "Input data row" for the label name I would surely have typed it wrong somewhere.

Dot syntax

Now it seems that the correct way would be to use the following to create the label

item.labels.assert(LABEL_INPUT_DATA_ROW, row);

and the following to get the label

double test = patient.labels[LABEL_INPUT_DATA_ROW].value;

and the following to change the label

patient.labels[LABEL_INPUT_DATA_ROW].value = 5;

Is this correct?

Thank you!

Kind regards,

Axel

FlexSim 17.1.2
labelsdot syntax
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

anthony.johnson avatar image
1 Like"
anthony.johnson answered

That is correct.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.