Path: news.easynews.com!core-easynews!newsfeed1.easynews.com!easynews.com!easynews!newsfeed-east.nntpserver.com!nntpserver.com!chi1.webusenet.com!news.webusenet.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!news1.calgary.shaw.ca.POSTED!not-for-mail X-Trace-PostClient-IP: 24.81.85.140 From: "Maximus" Newsgroups: comp.databases.oracle.tools References: <8e6b14d8.0306051249.6ef16ddd@posting.google.com> Subject: Re: Looping(all blocks, all records, all items) multi and single record blocks) will this work? Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Fri, 06 Jun 2003 18:53:10 GMT NNTP-Posting-Host: 24.67.253.205 X-Complaints-To: abuse@shaw.ca X-Trace: news1.calgary.shaw.ca 1054925590 24.67.253.205 (Fri, 06 Jun 2003 12:53:10 MDT) NNTP-Posting-Date: Fri, 06 Jun 2003 12:53:10 MDT Organization: Shaw Residential Internet Xref: core-easynews comp.databases.oracle.tools:59390 X-Received-Date: Fri, 06 Jun 2003 11:52:26 MST (news.easynews.com) "steve deno" wrote in message news:8e6b14d8.0306051249.6ef16ddd@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.