xBrowse anomoly

User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse anomoly

Post by nageswaragunupudi »

In that case, can you please do this small test?

For the purpose of testing, please temporarily add this line of code in your program:

Code: Select all

oBrw:bRClicked  := { |r,c,f,o| XBrowse( o:oDbf:aStruct, o:oDbf:ClassName() ) }
 
Please run the program with this change and right click anywhere on the browse. You will see a browse of oDbf:aStruct.
Can you please share a screenshot of this browse? This may give a clue for the problem.
Regards

G. N. Rao.
Hyderabad, India
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: xBrowse anomoly

Post by James Bott »

Tim,

I'm confused. You seem to want the picture to be "C" instead of "N" ? Then can't you just define the picture "@X"? X allows letters (upper and lower case), symbols, and numbers.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: xBrowse anomoly

Post by TimStone »

The second and third field are the ones displayed in the browse. Note the third field is C 30 but later you see the picture 99999.99

Image

Again, this applies on different, but not all, databases. When it does occur, it is consistent. Adding a PICTURE clause to the command corrects the display problem you see here, so this only occurs with the default settings.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse anomoly

Post by nageswaragunupudi »

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

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

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

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

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: xBrowse anomoly

Post by TimStone »

Thank you. That gives me sufficient information to work with to find the source of this problem.

Yes, I've run the tests, and now I can dig into it from there.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse anomoly

Post by nageswaragunupudi »

TimStone wrote:Thank you. That gives me sufficient information to work with to find the source of this problem.

Yes, I've run the tests, and now I can dig into it from there.

Tim
May we know if you found the solution? If so, can we expect you to share it with us?
Regards

G. N. Rao.
Hyderabad, India
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: xBrowse anomoly

Post by TimStone »

I did not YET find an answer. I used a work around for the problem for now. I will post an answer when I find the source of the problem.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
Post Reply