DataSet assignment of Numeric ... thinks its a Character ?
Publicado: Mié May 02, 2007 6:20 pm
Hi,
The following code snippet gives odd results.
The first 6 fields get to database OK.
The PALLETS field gets a message like
'FieldPut expects a N & received a C'
This makes no sense as nPallets or the direct assignment of 34 are visibly numeric.
PALLETS field on dbf is N4
//////////////////////////////////////////////////////////// ////////
oDiaryDs:AddNew()
oDiaryDS:TRANNO := nTranno
oDiaryDS:DELYDATE := ::oParent:dSelectedDate
oDiaryDS:DELYTIME := alltrim( cDelyTime )
oDiaryDS:SUPPID := ::oSuppIDEdit:Value
oDiaryDS:SUPPNAME := ::oSuppNameEdit:Value
oDiaryDS:PONUMB := val( ::oPoNumEdit:Value )
logdisplay( "nPallets", nPallets, valtype( nPallets ) ) This confirms nPallets is NUMERIC
oDiaryDS:PALLETS := nPallets
// oDiaryDS:PALLETS := 34 This has same result.
oDiaryDS:Update()
/////////////////////////////////////////////////////////
I have replaced this code with traditional aliassed field replaces & it works fine.
Am trying to isolate the problem in a small project.
Any thoughts please??
Chris
Chris Gillard
Blue Square Software
02380 458737
www.bluesquare.co.uk
The following code snippet gives odd results.
The first 6 fields get to database OK.
The PALLETS field gets a message like
'FieldPut expects a N & received a C'
This makes no sense as nPallets or the direct assignment of 34 are visibly numeric.
PALLETS field on dbf is N4
//////////////////////////////////////////////////////////// ////////
oDiaryDs:AddNew()
oDiaryDS:TRANNO := nTranno
oDiaryDS:DELYDATE := ::oParent:dSelectedDate
oDiaryDS:DELYTIME := alltrim( cDelyTime )
oDiaryDS:SUPPID := ::oSuppIDEdit:Value
oDiaryDS:SUPPNAME := ::oSuppNameEdit:Value
oDiaryDS:PONUMB := val( ::oPoNumEdit:Value )
logdisplay( "nPallets", nPallets, valtype( nPallets ) ) This confirms nPallets is NUMERIC
oDiaryDS:PALLETS := nPallets
// oDiaryDS:PALLETS := 34 This has same result.
oDiaryDS:Update()
/////////////////////////////////////////////////////////
I have replaced this code with traditional aliassed field replaces & it works fine.
Am trying to isolate the problem in a small project.
Any thoughts please??
Chris
Chris Gillard
Blue Square Software
02380 458737
www.bluesquare.co.uk