Page 1 of 1

TZSequence setting value

Posted: 27.01.2006, 20:57
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

Posted: 28.01.2006, 12:19
by zippo
I would like to know this, too... :)

Posted: 02.03.2006, 17:15
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.

Posted: 04.03.2006, 12:21
by darkbrain
Thanks i'will try