FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse anomoly
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: xBrowse anomoly

Posted: Thu Apr 30, 2020 12:00 AM
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 (fw): Select all Collapse
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: xBrowse anomoly

Posted: Thu Apr 30, 2020 09:44 PM

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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: xBrowse anomoly

Posted: Thu Apr 30, 2020 10:37 PM
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



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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: xBrowse anomoly

Posted: Fri May 01, 2020 03:18 AM
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 (fw): Select all Collapse
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 (fw): Select all Collapse
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 (fw): Select all Collapse
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 (fw): Select all Collapse
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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: xBrowse anomoly

Posted: Fri May 01, 2020 05:19 PM

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: xBrowse anomoly

Posted: Thu May 14, 2020 03:58 AM
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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM

Re: xBrowse anomoly

Posted: Thu May 14, 2020 09:03 PM

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit

Continue the discussion