Problem with NewValue and OldValue

In this forum all bug reports concerning the 6.x branch will be gahtered. You have the possibility to track the bug fix process.

Moderators: EgonHugeist, mdaems

Post Reply
rpelisson
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 23.01.2006, 12:26

Problem with NewValue and OldValue

Post by rpelisson »

Hi !

When I'm using them command NewValue for verify the OldValue for the Field, the returned value from NewValue it's different of write.

Example, in a table PARCELAS exists a record with this fields:
DUPLICATA: 000001
VENCIMENTO: 20/01/2005

If I want to verify, on a event TDBGrid.OnColExit if the new value (wrote) for the Field VENCIMENTO was different from OldValue (from the record)

Code: Select all


If (Table1.FieldByName('Vencimento').NewValue<>Table1.FieldByName('Vencimento').OldValue) Then
  Showmessage('Different')
Else
  Showmessage('Equal!');

gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post by gto »

I've never used the OldValue and NewValue, but you can use the OnSetText method of the field instead. (into the table/query, click on the field, event, onSetText).

There, you can see when a new value will be setted to the field, accessing the new value via the Value constant (defined in onSetText) and accessing the old value as you normally do, QueryNameFieldName.Value or QueryName.FieldByName('FieldName').AsSomeType.
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
rpelisson
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 23.01.2006, 12:26

Thanks

Post by rpelisson »

Oppsss, ok !

I'm post in english...

=)
Last edited by rpelisson on 23.11.2006, 11:03, edited 1 time in total.
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Re: Thanks

Post by gto »

rpelisson wrote:GTO, valeu carinha.

Eu também uso o Value, é que o pessoal utilizava isso em BDE, então. Já viu!
You're welcome =)
Ahm, try to keep it in english, so everybody can understand ;)

---

De nada =)
Tente postar em inglês, aí todo mundo entende.
Galera fica meio braba por aqui se postar em português.. só por PM ;)
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
Post Reply