Hello, me again. Is it becoming clear I'm developing something?
Are you already aware that empty cells of data type integer in tablefiles are returning a void value?
They used to return 0 (zero)
I already fixed the loop to avoid void values but it used to work better the other way.
Solved! Go to Solution.
We changed this intentionally.
It was always confusing for beginners that comparing an empty cell with VOID returned true, but reading out the content of an empty cell did not return VOID.
TableFile[1,1] := void -- make the cell empty
print TableFile[1,1] = void -- prints true print TableFile[1,1] -- prints 0 for an empty integer cell
The main reason we changed this, is that we think it will help you to find bugs in your SimTalk code. In SimTalk 1.0 it was hard to find out that you accidentally read out an empty cell. You had to explicitly set the number of columns and rows, if you wanted to get an error when you read beyond the list dimensions. This is impracticable if you dynamically add and delete rows. Even if the dimension is fixed, it still can happen that you accidentally read out a table that has not yet been filled.
So we decided that in SimTalk 2.0 you have to set the cell to 0 if you want the cell to return 0. That does not sound odd, right?
There is just one exception for this rule. An empty cell of the data type string returns the empty string "" instead of VOID. The reason is, that it is impossible to interactively enter an empty string into a table. The cell will always become VOID instead. In addition, the data type string is the only data type that has a value (the empty string) that cannot visually be distinguished from VOID (except if you activate the ribbon button "Highlight Empty Cells").
The upcoming version 12.2 will have a SimTalk 1.0 to SimTalk 2.0 converter that you can use to automatically convert the source code into the new syntax. This converter actually works quite well, but the behavior change for empty table cells turned out to be problematic. So, in order to improve the compatibility / portability, we decided that in version 12.2 we go back to the old SimTalk 1.0 behavior, i.e. empty table cells return the default value in SimTalk 2.0 Methods too.