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_SALESORDER
MYORDER=NewInstance C_SALESORDER AllocGroup Null

# Instantiate 5 lines and 3 line details in every line
  For I=1 to 5
    MYORDER.LINE(I)=NewInstance C_SORDERLINE AllocGroup MYORDER
    # MYORDER.LINE(I).allocgrp is equal to MYORDER.allocgrp
    For J=1 to 3
      MYORDER.LINE(I).SUBLINE(J)=NewInstance C_SLINEDETAILS AllocGroup MYORDER.LINE(I)
      # or (simpler !)
      # MYORDER.LINE(I).SUBLINE(J)=NewInstance C_SLINEDETAILS AllocGroup MYORDER
    Next J
  Next I

# Handle the sales order and then insert it into the database
  Call 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