Re: Looping(all blocks, all records, all items) multi and single record blocks) will this work?

From: Maximus <qweqwe_at_qwqwewq.com>
Date: Fri, 06 Jun 2003 18:53:10 GMT
Message-ID: <qq5Ea.164265$Vi5.4654346_at_news1.calgary.shaw.ca>


"steve deno" <sldcrew2k_at_yahoo.com> wrote in message news:8e6b14d8.0306051249.6ef16ddd_at_posting.google.com...
> Hi all,
>
> I am trying to loop through all records in all blocks and hit all
> items, to check their values/properties. I have a procedure and it
> ALMOST seems to work in the following code. However, I think that the
> fact of where I am navigating at which time is causing an issue. the
> result is that I hit all blocks andd items but not all records in
> multi-record blocks. to start, I see in the debugger that
> :SYSTEM.last_record has no value. Is this my problem? All help is
> appreciated. Thanks very much
>
> BEGIN
> cur_frm := :SYSTEM.Current_Form;
> cur_blk := Get_Form_Property(cur_frm,FIRST_BLOCK);
> lst_blk := Get_Form_Property(cur_frm,LAST_BLOCK);
> cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
> lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
>
> WHILE cur_blk <> lst_blk LOOP--BLOCK--

GO_BLOCK(cur_blk); << need to add this here

> First_Record;
> WHILE :SYSTEM.last_record != 'TRUE'LOOP--RECORD--
> WHILE cur_itm <> lst_itm LOOP--ITEM --
> My code to be run on every item of every record of every block
> in my form
> cur_itm := cur_blk||'.'||GET_ITEM_PROPERTY(cur_itm, NEXTITEM);
> END LOOP;--ITEM --
> NEXT_RECORD;
> END LOOP;--RECORD--
> cur_blk := GET_BLOCK_PROPERTY(cur_blk, NEXTBLOCK);
> cur_itm := cur_blk||'.'||Get_Block_Property(cur_blk,FIRST_ITEM);
> lst_itm := cur_blk||'.'||Get_Block_Property(cur_blk,LAST_ITEM);
> END LOOP;--BLOCK--
>
> END;
You need to use GO_BLOCK(cur_blk) before FIRST_RECORD to make it the active block before you start looping through it's records. Received on Fri Jun 06 2003 - 20:53:10 CEST

Original text of this message