I have an array of a structure: myStructure[0..100]
I would like to index that structure by name.
It works by giving each index a name:
P101_AI := 9
P102_AI := 10
P103_AI := 11
P104_AI := 12
So indexing a member in the structure: myStructure[P103_AI].value
(i.e. indexing myStructure[11].value)
However, is it possible to index this indirectly?
i.e. if delcaring TempString : STRING[30];
altering TempString at runtime to index the array.
Here is some pseudocade to describe what I would like to do:
FOR i:=101 TO 104 DO
TempString := CONCAT('P',i);
TempString := CONCAT(TempString,'_AI');
MyStructure[ indirect(TempString)].value := 'some value';
END_FOR;