Skip to content

GET_MODELGROUP_PARENT ​

GET_MODELGROUP_PARENT returns the id of the parent modelgroup of one modelgroup.

Syntax ​

leo-grammar
CC "Core" GET_MODELGROUP_PARENT mgroupid:intValue

#--> RESULT ecode:intValue parentmgroupid:idValue

Parameters ​

  • mgroupid (intValue) - specifies the ID of the modelgroup

Returns ​

  • ecode (intValue) - Contains the error code or is 0 in case of success.
  • parentmgroupid (intValue) - id of the parent modelgroup (the modelgroup that contains the selected modelgroup.

Details ​

See Also ​

Examples ​

Getting the parent modelgroup

leo-grammar
# let the user select a modelgroup
CC "CoreUI" MODEL_SELECT_BOX without-models mgroup-sel

# get the name of the parent modelgroup
CC "Core" GET_MODELGROUP_PARENT mgroupid:(VAL token(mgroupids,0," "))

IF (ecode = 0)
{
   CC "Core" GET_MODELGROUP_NAME mgroupid:(parentmgroupid)
}

# display the name
IF (ecode = 0)
{
   IF (mgroupname = "root")
   {
      CC "AdoScript" INFOBOX "You selected a top-level modelgroup!"
   }
   ELSE
   {
      CC "AdoScript" INFOBOX ("The selected the modelgroup is within " + mgroupname)
   }
}

Versions and Changes ​

Available since ADOxx 1.3