Halcust requirements for Version 8.4
UNILYNX
7-13-18
Hi,

Can someone please send me the requirements for modifying exiting Hal code so that it conforms with the requirements for auto-updating versions?

We want to move all our customers to V8.4, but need to check that Hal code is in the correct format.

Please email to andr@unilynx.net
UNILYNX
7-13-18
Re above, email address is andro@unilynx.net

Thanks
Giuseppe L.
7-16-18
Hello and thank you for reaching out to us with your question.

Below the specifications you asked:

Since version 8.0 there is a new syntax for redefining Register definitions.

Until version 8.0
Previously you would have to Include full register definition, add new fields to record header, new fields to a matrix, add new indexes to the record.

On version update, you had to compare old definition with the new one, put the custom fields in the correct place (end of definition). Then you had to write and import function that would link all the values from the old data structure to the new one.


Version 8.0 and up

New primitives are introduced: RecordAddBegin and EndRecordAdd.
Between these two primitives, you define the new fields/indexes just like you used to do before.
For example:


RecordAddBegin(CUVc,"CUVc_Custom");
RecordField(CustomStr,M4Str,255,0);
RecordField(CustomInt,M4Int,0,0);
ArrayField(CustArrStr,M4Str,255,0);
ArrayField(CustArrInt,M4Int,0,0);

ChangeField(Code,M4Code,30,0);
ChangeField(Name,M4UStr,100,0);

ChangeMatrixField(CustCode,M4Code,30,INVc);

DisableIndex("Name");


KeyBegin(NewKey);
KeySegment(CustomStr);
KeySegment(Code);
SubSetKeyBegin2(CustArrStr);
AppendMatrixFieldToKeyName(CustArrStr,0);
KeySegment(Code);

EndRecordAdd;

Version update:
On next version update, you don't have to do anything. Even if the register has new fields, it will do export/import correctly and link all the fields as necessary. So no need to compare register definitions and no need for import functions anymore.


Important:
- RecordAddBegin has a second parameter - import tag, which is mandatory to have. It works the same way as for RecordBegin primitive.

Restrictions:
- You won't be able to put existing registers' full definitions anymore. This will cause hal compiler error.

Limitations (at the moment):
- Not possible to Segments to existing indexes.
UNILYNX
7-17-18
Created byGiuseppe L.14:18 16 July 2018
Hello and thank you for reaching out to us with your question. Below the specifications you asked: Since version 8.0 there is a new syntax for redefining Register definitions. Until version 8.0 Previously you would have to Include full register definit
Thank you very much, will pass this on.


Vlado Marko
6-19-19
Is it still the case that it is not possible to add segments to existing indexes within RecordAddBegin/EndRecordAdd?

I need to add a segment in particular to Main Key
David Delač
12-28-19
Hi,

RecordAddBegin;
DisableIndex(MainKey);
MainKeyBegin(...)
EndRecordAdd;

This should work just fine. I think it's a bad idea to rename the main key, so use the same name for it but doing this has other consequences for master code.

e.g. master code might think two records are the same record but they are not (because main key now has 1 more segment) and if this works depends on what register.

Best Regards,
David D.
HansaWorld Support


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
Piotr Wycichowski
Is it something when a user tried to use any of AI commands in SERP? /Piotr W....
10:07 8 Nov 2024
Brittany McGrath
Thank you for your post Lilian. I see this post has been submitted twice and the second post is being addressed so I will close this duplicate. Thank you. ...
09:41 5 Nov 2024