[SOLVED] Creating an array and giving it as FB output [message #1791272] |
Wed, 27 June 2018 12:23 |
Agostino Mascitti Messages: 15 Registered: May 2018 |
Junior Member |
|
|
Hello,
I am trying to create an array and give it as FB output. For example, the FB has an output field COUNTER of type ARRAY[3]. You want to assign it the array {1,0,1}.
I have seen in FORTE_SET_AT_INDEX::executeEvent() that you can do:
CIEC_ARRAY &rOutArray = static_cast<CIEC_ARRAY&>(OUT_ARRAY());
rOutArray[INDEX()]->saveAssign(VALUE());
Thus, I have tried something:
int counters[3] = {566,0,1011};
CIEC_ANY *c = 0;
char temp[12] = "";
sprintf(temp, "INT#%d", counters[i]);
printf("%s\n", temp);
c->fromString(temp);
printf("c=%d\n", c);
COUNTER_Array()[static_cast<TForteUInt16>(i)]->saveAssign(*c);
COUNTER_Array().fromString("[556,0,1011]");
but the code CIEC_ARRAY::fromString() has the comment "//TODO: for full compliance support of multiple element-statements must be implemented".
[Updated on: Thu, 28 June 2018 14:10] Report message to a moderator
|
|
|
|
Re: Creating an array and giving it as FB output [message #1791275 is a reply to message #1791273] |
Wed, 27 June 2018 12:33 |
|
Hi,
I'm not sure if I understand the problem. fromString for single arrays definitly works. We have unit tests for that. The comment is that we currently are not supporting arrays of arrays. In ST you can also access in standard ST syntax each array element with the bracket operator (i.e., []).
Alois
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06859 seconds