Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread assigning integer value
Thu, May 24 2007 7:37 AMPermanent Link

"Iztok Lajovic"
Hello all,

maybe has anybody encountered the same problem as I did and knows the
solution:

For editing purposes I copy selected record to memory table which I create
at run time by assigning fieldDefs from the source table. In source table
there is an integer field with value greater than 32767. This value was
entered by a program and I can put such great value with DBSYS as well.

When I want to assign value at run time from source table to memory table I
get an exception telling me that value is greater than alowed value for
integer field which is in range -32766 .. 32767. The both statements below I
get the same exception:

memTable.fields[i].asInteger :=
sourceTable.fieldByName(memTable.fields[i].fieldname).asInteger;
memtable.fields[i].assign(sourceTable.fieldByName(memTable.fields[i].fieldname));

Thanks for suggestions
Iztok Lajovic

Thu, May 24 2007 5:14 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Iztok,

<< When I want to assign value at run time from source table to memory table
I get an exception telling me that value is greater than alowed value for
integer field which is in range -32766 .. 32767. The both statements below I
get the same exception: >>

It sounds like the field defs copy isn't working exactly as you would think.
Do you have any ftSmallInt fields in the table ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, May 25 2007 2:26 AMPermanent Link

"Iztok Lajovic"
Tim,

> << When I want to assign value at run time from source table to memory
> table I get an exception telling me that value is greater than alowed
> value for integer field which is in range -32766 .. 32767. The both
> statements below I get the same exception: >>
>
> It sounds like the field defs copy isn't working exactly as you would
> think. Do you have any ftSmallInt fields in the table ?
>

Yes, one at the end of field list, but the field with problem is ftInteger
type.

Iztok

Fri, May 25 2007 2:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Iztok,

<< Yes, one at the end of field list, but the field with problem is
ftInteger type. >>

Yes, but are you sure that you're assigning the value to an ftInteger field
and not an ftSmallInt field ?

Perhaps you could post the entire code that you're using.  That should help
a bit.

--
Tim Young
Elevate Software
www.elevatesoft.com

Sun, May 27 2007 3:27 AMPermanent Link

"Iztok Lajovic"
Tim,

> Yes, but are you sure that you're assigning the value to an ftInteger
> field and not an ftSmallInt field ?

I found it. There was a side effect with TwwDBLookupcombo where the source
field was integer field in question and lookuptable had a ftSamllInt field
in primary key.

Thanks for help
Iztok Lajovic

Image