Re: How to programmatically through a multirow block - Forms 4.5?

From: <garethgadd_at_my-dejanews.com>
Date: Wed, 09 Sep 1998 14:58:52 GMT
Message-ID: <6t653c$ako$1_at_nnrp1.dejanews.com>


[Quoted] In article <01bddba9$57f916e0$c70c400a_at_cms_bssup>,   "Andy Hardy" <aph_at_glink.net.hk> wrote:
> Hi,
>
> I have a multirow block which contains a date. I'd like to 'centre' the
> cursor on the date which is closest to sysdate.
>
> So far I have achieved this through use of three loops and the next_record
> and previous_record commands - one to find the closest record, another to
> go past it a certain number of records and a final one to go back to the
> closest record!
>
> This seems cumbersome, there must be a proper way of doing it!
>
> Ideas?
>
> Andy

You could create two form parameters, one to hold a value for Record No (Parameter A) and one to hold a date value (Parameter B). I'm assuming that your multi row block is populated as a result of a query so in the POST-QUERY trigger of this block, when the first record is returned you would populate Parameter B with this date. For each subsequent record evaluate whether the date returned is greater than the date stored in Parameter B, if it is then populate Parameter B with the new date value and Parameter A with the record [Quoted] number. When all records are returned, you will have the Record No stored as [Quoted] Parameter A. Then wherever you are doing all your loop processing which you [Quoted] no longer need issue a go_record command using the value held in Parameter A. [Quoted] there is no need to make any comparisons to sysdate (from what you've said) [Quoted] as the record you wish to go to will be the greatest date value of those returned (assuming that all dates are in the past). If that is not the case [Quoted] than create another Parameter - Parameter C to store sysdate at form startup [Quoted] and make your comparisons against this value. Hope the above is of some help [Quoted] and the processing should be alot quicker than using a series of loops..

Gareth

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Wed Sep 09 1998 - 16:58:52 CEST

Original text of this message