The picture clause "99999.99" in the 7th column of the field "SERVICE" is the cause of the problem. This picture clause corresponds to a numeric field with fieldlength 8 and fielddec 2. But this field is a character field.
When TDatabase class opens a DBF, it copies DBSTRUCT() to oDbf:aStruct, extends the array and after examining each field stores (a) picture clause for numeric fields (only) in column 7, (b) index tag corresponding the field in column 8 and (c) readonly attribute (eg. datatypes +,=,etc) in column 11.
For example, the index tag "EGLSGP" is stored in column 8 corresponding to the field "SYSTEM". Please confirm if this is the correct index tag.
The programmer can change or assign a new picture clause to a field or find out the existing picture clause by calling
- Code: Select all Expand view RUN
oDbf:FieldPic( <fieldname/fieldNo>, [cNewPic] ) --> cPic
When we create XBrowse for a TDatabase object, XBrowse calls oDbf:SetXBrowse(...) to configure the browse. In other words, it is TDatabase that actually configures the browse. While configuring, TDatabase sets oCol:cEditPicture same as the picture clause in column 7 of the corresponding field.
In our case, TDatabase set the picture clause of 2nd column "Description" of xbrowse with "99999.99" because this is stored in the 7th column corresponding to the field "SERVICE".
We now need to find out how this picture clause is assigned by the class "TGROUPLIST" to a character field.
TDatabase, for sure, does not assign any picture clause to a character field.
TGROUPLIST is a derived class, probably TGROUPLIST <-- TDATA <-- TDATABASE.
We now need to find out where this picture clause came here in this chain of derivations.
First Step:
Open this DBF directly with TDatabase
- Code: Select all Expand view RUN
oDbf := TDatabase():Open( nil, <dbfname>, <yourRDD>, .t. )
XBROWSER oDbf:aStruct
Do we see any picture clause in the 7th column of the field "SERVICE"?
Kindly check this and confirm.
Second Step:- Code: Select all Expand view RUN
oDbf := TData():New( nil, <dbfname>, <yourRDD>, .t. )
oDbf:Use()
XBROWSER oDbf:aStruct
Do we see any picture clause in the 7th column of the field "SERVICE"?
Kindly check this and confirm.
Third Step:
- Code: Select all Expand view RUN
oDbf := TGroupList():New()
XBROWSER oDbf:aStruct
Do we see any picture clause in the 7th column of the field "SERVICE"?
Kindly check this and confirm.
We await your reply.