Navigation through DB with Revolution

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Dec 20 11:26:55 CST 2007


On 20/12/07 4:24 PM, "Christian Langers" <christian.langers at education.lu>
wrote:

Hi Christian, 

> Hi again,
> 
> the VTable_RecID( tblRef, x)  method with the slider scrollbar in Rev
> is great for fast navigation through the DB as long as you don't
> delete any record.
> 
> As the RecId won't reorder themselves you can't really enjoy the
> slider navigation :-(
> 
> 
> Here the script that makes the slider navigation possible :
> 
> global mSerials
> 
> on scrollbarDrag pScrollValue
>    get VTable_RecId(mSerials,pScrollValue)
>    fillRevFieldsWithDbData 
> end scrollbarDrag

1) as to somebody else (Marc?) I point you that you going to use API way,
    You realize this?

API way have benefits but require MORE job from developer.
If you want be more LAZY then you can consider switch to SQL way and
Vcursors.


2) yes RecID of deleted records make wholes.

The most correct way to work with RecIDs and tables on API (low) level is:

Pseudo-code:

    setAll = table.SelectAllRecords() -- this return you SET of VALID RecIDs

    -- now you can ask set how much records it have:
    count = setAll.Count

    -- now you can iterate this set of RecIds using SetIterator:
    
3) if you want make this as random access set,
    then you need make sure that you have on hands VArraySet,
    because it have method N

       RecId rid = VArraySet.GetItemAt( pScrollValue )     -- any position


And only now you can do safe jump to this RecID.

    get VTable_RecId(mSerials, recID)
    

I really not sure that script-developer, i.e. Revolution developer
May prefer to use API way to SQL way.



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list