Detecting last record in a found set in a script step?

  • Follow


I have a script that cycles through records in a found set.  How do you tell 
when you have processed the last record in the set?  The current error status 
remains 0 when you recquest another record but there are none.

0
Reply rkayton 6/21/2005 2:14:56 PM

On Tue, 21 Jun 2005 10:14:56 -0400 (EDT), Richard Kayton wrote:
>  I have a script that cycles through records in a found set.  How do you tell 
>  when you have processed the last record in the set?  The current error status 
>  remains 0 when you recquest another record but there are none.

goto next record. exist on last

.... should do what you need.

Otherwise you might do an extra check whether the current record number
= found numnber. Pick the matching get functions.
0
Reply Martin 6/21/2005 2:24:41 PM


I am not sure what you mean below where you exit on last.  As far as I can 
tell there is no explicit status that indicates that you have reached the last 
record in a found set.  The closest seems to be the current record number but 
what happens after you process the last record and then do a skip to the next 
record?  

Sincerely,



In article <slrndbg8p9.ae.t-use@ID-685.user.individual.de>, t-use@gmx.net 
says...
>
>On Tue, 21 Jun 2005 10:14:56 -0400 (EDT), Richard Kayton wrote:
>>  I have a script that cycles through records in a found set.  How do you 
tell 
>>  when you have processed the last record in the set?  The current error 
status 
>>  remains 0 when you recquest another record but there are none.
>
>goto next record. exist on last
>
>... should do what you need.
>
>Otherwise you might do an extra check whether the current record number
>= found numnber. Pick the matching get functions.

0
Reply rkayton 6/21/2005 3:02:46 PM

On Tue, 21 Jun 2005 11:02:46 -0400 (EDT), Richard Kayton wrote:
>  I am not sure what you mean below where you exit on last.  As far as I can 
>  tell there is no explicit status that indicates that you have reached the last 
>  record in a found set.  The closest seems to be the current record number but 
>  what happens after you process the last record and then do a skip to the next 
>  record?  

when you are within a loop, the exit on last will exit the loop.

when you are within a script otherwise, you will exit the script.
0
Reply Martin 6/21/2005 3:29:28 PM

There is no need to look at any status.

In the script which cycles through the records, you have a loop, at the 
end of which is a "Go To Record/Request/Page step. Click on that step.

At the bottom right of the script definition window is where you tell the 
step which record to go to: first / last / next / previous / by number / 
by field value. Assuming you have "next" selected, to the left of the 
selection there is a checkbox option "Exit after last." Check that.

That's all.

Matt

On 6/21/2005, Richard Kayton wrote:

> I am not sure what you mean below where you exit on last.  As far as I 
can
> tell there is no explicit status that indicates that you have reached 
the last
> record in a found set.  The closest seems to be the current record 
number but
> what happens after you process the last record and then do a skip to the 
next
> record?
>
> Sincerely,
>
>
>
> In article <slrndbg8p9.ae.t-use@ID-685.user.individual.de>, t-use@gmx.net
> says...
> >
> > On Tue, 21 Jun 2005 10:14:56 -0400 (EDT), Richard Kayton wrote:
> >>  I have a script that cycles through records in a found set.  How do 
you
> tell
> >>  when you have processed the last record in the set?  The current 
error
> status
> >>  remains 0 when you recquest another record but there are none.
> >
> > goto next record. exist on last
> >
> > ... should do what you need.
> >
> > Otherwise you might do an extra check whether the current record number
> > = found numnber. Pick the matching get functions.
0
Reply Matt 6/21/2005 3:43:35 PM

4 Replies
412 Views

(page loaded in 0.066 seconds)

Similiar Articles:













7/28/2012 8:09:35 AM


Reply: