Saturday, May 3, 2014

"illegal address in script" when using anonymous table in Dexterity

I'm working on an overdue project on a Saturday. I'm getting this weird "illegal address in script" when using an anonymous table. So far i've wasted 4 hours on this issue.

Here's kinda what it looks like, simplified down:

script 1:
in boolean workTable;
local anonymous table tbl;
OpenTableByName, table tbl, workTable;


OpenTableByName script:
in string optionA;
in string optionB;
inout anonymous table tbl;

if workTable then
   open table tbl with name "workTable";
else
    open table tbl with name "historyTable";
end if;

This blows up with the error message when it's calling OpenTableByName. If I extract the tiny bit of code from that into the calling code it works just fine. This *must* mean you cannot pass an unopened anonymous table into a script. It *must* have to be opened before passing it to another script.

I just love finding these undocumented, dumb issues in Dexterity. It's dumb because the error message makes no sense whatsoever. Why can't the error say something useful, like "unopened anonymous table passed to a script. Can't do that!"

Just another stupid Dexterity quirk. Not the first one that's wasted HOURS UPON HOURS of my time, and won't be the last.





No comments:

Post a Comment

There was an error in this gadget