xBrowse anomoly

Re: xBrowse anomoly

Postby nageswaragunupudi » 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: Select all  Expand view

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
nageswaragunupudi
 
Posts: 10295
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse anomoly

Postby James Bott » Thu Apr 30, 2020 9: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xBrowse anomoly

Postby TimStone » 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

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
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
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: xBrowse anomoly

Postby nageswaragunupudi » Fri May 01, 2020 3: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: Select all  Expand view

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

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

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

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
nageswaragunupudi
 
Posts: 10295
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse anomoly

Postby TimStone » Fri May 01, 2020 5: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
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: xBrowse anomoly

Postby nageswaragunupudi » Thu May 14, 2020 3: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
User avatar
nageswaragunupudi
 
Posts: 10295
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse anomoly

Postby TimStone » Thu May 14, 2020 9: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
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 33 guests