Allocgrp

This built-in property returns the allocation group of an instance. Allocgrp is essentially a technical property and is rarely used.

The allocation group is shared between instances that have to be freed at the same time. This is ensured by the mention of a group in NewInstancesyntax.

Syntax

MYINSTANCE.allocgrp

Example

# This program creates a C_SALESORDER instance # with C_SORDERLINE child instances and C_LINEDETAILS grandchild instances.# All these instances are created in the same allocation group.Local Instance MYORDER Using C_SALESORDERMYORDER=NewInstance C_SALESORDER AllocGroup Null# Instantiate 5 lines and 3 line details in every lineFor I=1 to 5MYORDER.LINE(I)=NewInstance C_SORDERLINE AllocGroup MYORDER# MYORDER.LINE(I).allocgrp is equal to MYORDER.allocgrpFor J=1 to 3MYORDER.LINE(I).SUBLINE(J)=NewInstance C_SLINEDETAILS AllocGroup MYORDER.LINE(I)# or (simpler !)# MYORDER.LINE(I).SUBLINE(J)=NewInstance C_SLINEDETAILS AllocGroup MYORDERNext JNext I# Handle the sales order and then insert it into the databaseCall MANAGE_MY_ORDER(MYORDER)Fmet MYORDER.AINSERT# Free all instances (they are all in the same allocation group)FreeGroup MYORDER

See also

Structure, Instance, SetInstance, NewInstance, null, FreeInstance, cast