xBrowse: how to retrieve field names...

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

Re: xBrowse: how to retrieve field names...

Post by nageswaragunupudi »

bosibila wrote:Mr Rao,

yes it is in my version. I try example with for/loop and :cHeader returns legal string array but :cExpr return "nil"

Code: Select all

for i=1 to len( oBrw:aCols )
        oCol:=oBrw:aCols[ i ]
        var1:=oCol:cExpr                      // returns"nil"
        var2:=oCol:cHeader                  // returns string array with headers...
next
 
I will tray to check why...

Best regards
No point wasting your time. I think the initial implementation was working only for RDDs.

So I suggest you do in your code what we do inside the library in the recent versions:

Code: Select all

   @ 0,0 XBROWSE oBrw OF oWnd OBJECT oQry COLUMNS aFields HEADERS aHead LINES CELL FASTEDIT

oBrw:cExprs := aFields  // Add this line after your XBROWSE command.
 
You can query for the column name with oCol:cExpr

When you upgrade the current versions, you can omit the extra line of code I suggested. Even if you do not omit it does not create any problem
Regards

G. N. Rao.
Hyderabad, India
User avatar
bosibila
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: xBrowse: how to retrieve field names...

Post by bosibila »

Thanks Rao,

Best regards
Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
Post Reply