Re-order blocks on forms? |
Post Reply
|
| Author | |
fblindhe
Newbie
Joined: 26-January-2010 Posts: 2 |
Post Options
Quote Reply
Topic: Re-order blocks on forms?Posted: 26-January-2010 at 12:02pm |
|
We added a new block to an object group that is used by all of our forms. When we open one of the forms in Developer, and it inherits the new block, the block is first block in the list. We need it to be at the bottom. Is it possible to write a FormsAPI Master script to re-order the blocks on a form so the new inherited block is the last block in the list? |
|
![]() |
|
administrator
Admin Group
Stefan Mueller Joined: 25-January-2003 Location: Japan Posts: 750 |
Post Options
Quote Reply
Posted: 26-January-2010 at 9:28pm |
|
Yes, that is no problem - check the helpfiles for a function called "Generic_Move()".
DECLARE frm number; blk number; BEGIN frm := Form_Load(C_FAPIMASTERDIR+'test.fmb'); blk := Generic_GetObjProp(frm, D2FP_BLOCK); while blk <> 0 do begin LogAdd( Generic_GetTextProp(blk, D2FP_NAME) ); blk := Generic_GetObjProp(blk, D2FP_NEXT); end; LogAdd('** move block10 to the end **'); --using "0" as next object parameter in generic_move -- will move it to the end. blk := Generic_FindObj(frm, 'BLOCK10', D2FFO_BLOCK); generic_move(blk, 0); blk := Generic_GetObjProp(frm, D2FP_BLOCK); while blk <> 0 do begin LogAdd( Generic_GetTextProp(blk, D2FP_NAME) ); blk := Generic_GetObjProp(blk, D2FP_NEXT); end; //free the form from memory Form_Destroy(frm); END. output: 14:25:15 [Info] Running script <noname.p2s> 14:25:15 BLOCK10 14:25:15 BLOCK11 14:25:15 BLOCK2 14:25:15 ** move block10 to the end ** 14:25:15 BLOCK11 14:25:15 BLOCK2 14:25:15 BLOCK10 14:25:15 [Info] Script execution finished |
|
![]() |
|
fblindhe
Newbie
Joined: 26-January-2010 Posts: 2 |
Post Options
Quote Reply
Posted: 27-January-2010 at 7:30am |
|
Thank you very much, Stefan. That is exactly what I was looking for.
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |