How to fill a string table FIFO

I am wanting to fill a table with error codes so I can see the actual errors before the strategy crashes and causes a restart. The error log is cleared when this happens and simply using PAC Terminal or Message Viewer also initiates the crash.

How would I set it up to shift all table contents by table[x+1] and insert the newest error into table[0] so I get a FIRST IN, FIRST OUT setup?

What about ‘Shift String Table Elements’?

I didn’t know about that command. :+1:
I will check it out.

Where is that? I cannot find that command. I can find “Shift Number Table Elements,” but not string.

Edit: oh no. It’s a v10 command…
I’m using 9.6…

Mary wrote this ages ago when we did not have that FIFO command;

// Add to the message log.
MsgLog_Messages[MsgLog_LastLogIndex] = MsgLog_NewMessage;

// Increment index and check for wrap around
MsgLog_LastLogIndex = MsgLog_LastLogIndex + 1;
if (MsgLog_LastLogIndex >= MSGLOG_LENGTH) then
  MsgLog_LastLogIndex = 0;
endif

I went ahead and updated the strategy to 10.4, but I am getting an error that doesn’t make any sense.

Here is the code:
If (IsErrorPresent()) then

ShiftStringTableElements(1,Error_Log);
CurrentErrorToString(',',strCurrent_Error);
Error_Log[0]=strCurrent_Error;
RemoveCurrentError();

EndIf

The ‘ShiftStringTableElements’ command is giving me this error:

Also, the table elements are not shifting after the first pass.


I am trying to log the errors in a table. The table is a string table and the variable is a string variable.
When I comment out the ‘ShiftStringTableElements’ command the errors stop.

This is how the chart runs: