Or if the range is [0:63), so [2,4,5,3,1] ≡ [B,D,E,C,A], then perhaps this
Code:char the_data[] = { "BDECA YWVXZ " }; char *p = the_data; int index; int array[2][5]; for (p=the_data+(index=0); *p; ++p) { if (*p & 64) { *(array[0]+index++) = *p; }
could be ported to structured text (without the pointers, of course).
Unfortunately not all AB processors support defining a string in structured text. I think I'll have a string like that for the User input custom build order but will keep the array of SINTs on the background, both for size and ease of use
Code:
//For loop for basic build order, pull values out for custom build order
for i := 1 to PP.PattData[1].NumCases do
PP.PattData[1].BuildOrderC[i] := i; //As Drawn Build order
PP.PattData[1].BuildOrderR[i] := PP.PattData[1].NumCases - (1-i); //Reverse Build order
end_for;
//Flipped Build order //Mirrored Build order
PP.PattData[1].BuildOrderF[1] := 3; PP.PattData[1].BuildOrderM[1] := 2;
PP.PattData[1].BuildOrderF[2] := 4; PP.PattData[1].BuildOrderM[2] := 1;
PP.PattData[1].BuildOrderF[3] := 2; PP.PattData[1].BuildOrderM[3] := 4;
PP.PattData[1].BuildOrderF[4] := 1; PP.PattData[1].BuildOrderM[4] := 3;
Still a rough draft but might make some tags more acronym like.