Syntax to add matrix in existing register
Neil
4-24-20
Operating system: Windows
How would I add a matrix to an existing register?

RecordAddBegin(CommodityVc,"CommodityVc_1");
RecordField(Math,M4Matrix,0,0);
ArrayBegin(Math,-,1);
ArrayField(Country,M4Code,5,CountryVc);
EndArray;
EndRecordAdd;

This sort of works but it crashes when recompiling.
Edgars Dzenis
4-24-20
Hi, Neil.
This should work. I just tried adding this way and it worked(on macos).
Can you provide window definition?
Neil
5-4-20
Hello Edgars,

I have created a small sample that causes the error. Only this datadef.hal, no other files. The issue is when developing in client mode, and I ctrl+f5 to recompile, I get the error:

"EndArray missing TestBlock". It doesn't occur on startup, only when recompiling after which it crashes the client.

This is on windows serp 2020-01-07.

Is it my syntax is wrong or some other issue?

datadef.hal:
begin

RecordAddBegin(CommodityVc,"CommodityVc_1");
RecordField(Math,M4Matrix,0,0);
ArrayBegin(Math,-,1);
ArrayField(Country,M4Code,5,CountryVc);
EndArray;
EndRecordAdd;

BlockBegin(TestBlock,-,"TestB");
RecordField(LastDate,M4Date,0,0);
EndBlock;

end;
Edgars Dzenis
5-4-20
Syntax is correct. It looks like there could be hal engine error that doesn't treat EndRecordAdd the same as EndRecord when recompiling. And that could cause EndArray not being activated, so it looks for EndArray in the next defined record(TestBlock in this case).
As a workaround you can add CommodityVc definition to the end of the file.

p.s. repeatable on macosx single user mode
Simone M.
5-7-20
Hi Neil,
I've just reported an internal issue for this.
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Andis Blicāns, Grasko
Hi, We have client using 8.5 2021-09-26 (build 85400383). The fields "Max Web Users" and "Max Sessions" ar blank. Server is closing itself almost every day. Message in hansa....
15:52 26 Apr 2024
Afternoon, Some of our customers haven't changed their passwords for a while but they're not getting any password expiry message. If I copy their Standard ID into a new user on some test ...
17:22 25 Apr 2024