Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 6 of 6 total |
Oldvalue |
Wed, Jun 1 2016 6:46 AM | Permanent Link |
Huseyin Aliz myBiss ApS | Hi again
I cannot understand why following does not work? Amountold := Dataset.columns['Amount'].Oldvalue; Error message: Expected integer, double or variant but instead found oldvalue Following works: Amountold := Dataset.columns['Amount'].asFloat; Am I missing something, documentation says oldvalue are a property just like asfloat? Regards, Hüseyin |
Wed, Jun 1 2016 7:19 AM | Permanent Link |
Matthew Jones | Hüseyin Aliz wrote:
> Hi again > > I cannot understand why following does not work? > > Amountold := Dataset.columns['Amount'].Oldvalue; > > Error message: > > Expected integer, double or variant but instead found oldvalue > > Following works: > > Amountold := Dataset.columns['Amount'].asFloat; > > Am I missing something, documentation says oldvalue are a property > just like asfloat? The source is really good for this sort of thing, particularly if you have a search tool (I use dtSearch as it can share the databases). Anyway, it finds me a sample with this: procedure TOrderEntryDlg.RemoveOldLineTotals; begin with Orders do begin Columns['PurchaseTotal'].AsFloat:=(Columns['PurchaseTotal'].AsFloat-Cust omerItems.Columns['PurchaseTotal'].OldValue.AsFloat); Columns['ShippingTotal'].AsFloat:=(Columns['ShippingTotal'].AsFloat-Cust omerItems.Columns['ShippingTotal'].OldValue.AsFloat); end; end; -- Matthew Jones |
Wed, Jun 1 2016 7:25 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | << I cannot understand why following does not work? Amountold := Dataset.columns['Amount'].Oldvalue; >> OldValue is a TDataValue instance, not a simple value, so you have to use AsString, AsInteger, etc. on it in order to grab the actual value: http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TDataColumn&prop=OldValue Tim Young Elevate Software www.elevatesoft.com |
Wed, Jun 1 2016 7:49 AM | Permanent Link |
Huseyin Aliz myBiss ApS | Matthew,
Thank you Regards, Hüseyin Den 01-06-2016 kl. 13:19 skrev Matthew Jones: > Hüseyin Aliz wrote: > >> Hi again >> >> I cannot understand why following does not work? >> >> Amountold := Dataset.columns['Amount'].Oldvalue; >> >> Error message: >> >> Expected integer, double or variant but instead found oldvalue >> >> Following works: >> >> Amountold := Dataset.columns['Amount'].asFloat; >> >> Am I missing something, documentation says oldvalue are a property >> just like asfloat? > The source is really good for this sort of thing, particularly if you > have a search tool (I use dtSearch as it can share the databases). > Anyway, it finds me a sample with this: > > procedure TOrderEntryDlg.RemoveOldLineTotals; > begin > with Orders do > begin > > Columns['PurchaseTotal'].AsFloat:=(Columns['PurchaseTotal'].AsFloat-Cust > omerItems.Columns['PurchaseTotal'].OldValue.AsFloat); > > Columns['ShippingTotal'].AsFloat:=(Columns['ShippingTotal'].AsFloat-Cust > omerItems.Columns['ShippingTotal'].OldValue.AsFloat); > end; > end; > |
Wed, Jun 1 2016 7:52 AM | Permanent Link |
Huseyin Aliz myBiss ApS | Tim,
Maybe you should write this as a note, it was not clear for me when i looked at it Regards, Hüseyin Den 01-06-2016 kl. 13:25 skrev Tim Young [Elevate Software]: > << I cannot understand why following does not work? > > Amountold := Dataset.columns['Amount'].Oldvalue; >> > > OldValue is a TDataValue instance, not a simple value, so you have to use AsString, AsInteger, etc. on it in order to grab the actual value: > > http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TDataColumn&prop=OldValue > > Tim Young > Elevate Software > www.elevatesoft.com > |
Fri, Jun 3 2016 8:10 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | << Maybe you should write this as a note, it was not clear for me when i looked at it >>
*What* wasn't clear ? It says right in the documentation that it's a *TDataValue* instance. A TDataValue instance is a class type, not a primitive type. This is basic stuff.... Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Thursday, May 23, 2024 at 07:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |