[SOLVED] Creating an array and giving it as FB output [message #1791272] |
Wed, 27 June 2018 08:23  |
Eclipse User |
|
|
|
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 10:10] by Moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03887 seconds