PROGRAM ListBlocks; {-- *************************************************************************** -- ** Descr. : Simple tutorial script to list all the blocks of a formsmodule. -- *************************************************************************** -- ** 13/12/01 1.002.00 added #2 to get all blocks -- ** 24/11/01 1.001.00 Initial Creation, muellers@orcl-toolbox.com -- ***************************************************************************} VAR frm : number; blk : number; sl : tstringlist; i : number; BEGIN //load the formsmodule frm := Form_Load(C_FAPIMASTERDIR+'test.fmb'); //one way to show all blocks, get the first blockobject and loop trough //until there are no more blocks (=0). logadd('all blocks #1:'); blk := Generic_GetObjProp(frm, D2FP_BLOCK); while blk <> 0 do begin LogAdd( Generic_GetTextProp(blk, D2FP_NAME) ); blk := Generic_GetObjProp(blk, D2FP_NEXT); end; //another way to show all blocks, use of the formsapi master builtin. logadd('all blocks #2:'); sl := API_GetSubObjects(frm, D2FP_BLOCK); for i := 0 to sl.count-1 do begin LogAdd( API_GetObjectName(sl.objects[i]) ); end; sl.free; //free the form from memory Form_Destroy(frm); END.