TZSequence setting value

Freature requests from users for ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
darkbrain
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 28.12.2005, 11:56

TZSequence setting value

Post by darkbrain »

Hi all,
i'm using TZSequence for my autoincrement fields whithout problem. Anyway i'd like to set a value for the generator, looking at the code i saw that it's not possible. I know that i can use a query to update the value but i prefer to use the component. Can you add this features?

thanks,
DarkBrain
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

I would like to know this, too... :)
martinalex
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 21.12.2005, 16:54

Post by martinalex »

>>i'd like to set a value for the generator, looking at the code i saw that it's not possible

It's already possible. :) You have to do one additional step then just setting a value.
You have to read the current value with ZSequence1.GetCurrentValue
and calculate the difference to the required value.
Set ZSequence1.BlockSize to the difference, the value can be negative.
and set the required value with ZSequence1.GetNextValue

Don't forget to set BlockSize to 1, which is the normal increment.

You always have to be careful when setting a value to a generator, since the value is perhaps no longer unique.
darkbrain
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 28.12.2005, 11:56

Post by darkbrain »

Thanks i'will try
Post Reply