DCBROWSE AND MY PROBLEM

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
slobodan1949
Posts: 86
Joined: Mon Apr 25, 2011 8:57 am
Location: SERBIA
Contact:

DCBROWSE AND MY PROBLEM

#1 Post by slobodan1949 »

Hi Roger,
I can't seem to find a solution. Please help.

How to retrieve the name of the DBF field being edited
from function: AFTER_EDITING(oBrowse)

DCBROWSE oBrowse ALIAS "TEST";
EDIT xbeBRW_ItemSelected ;
ACTION {|| AFTER_EDITING(oBrowse) }

DCBROWSECOL FIELD TEST->ID_NAME CARGO "ID_NAME" PARENT oBrowse

AFTER_EDITING(oBrowse)
oColon := oBrowse:getcolumn(ncol)
_cargo_ := var2char( oColon:CARGO[3] )
msgbox(_cargo_) //--> "ID_NAME"
return nil

Is there ANOTHER more elegant way without using CARGO

I'm confused by THIS, that in the same function it is possible to add a NEW column
to oBrowse by writing the name of the dbf field TEST->FLAG into the oXbpColumn object:

oXbpColumn := XbpColumn():new()
oXbpColumn:dataLink := {|| TEST->FLAG }
oXbpColumn:create()
oBrowse:addColumn( oXbpColumn )

I am convinced that there must be a way to get the DBF field name "FLAG"
without using CARGO. But I can't find it.

User avatar
SlavkoDam
Posts: 118
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: DCBROWSE AND MY PROBLEM

#2 Post by SlavkoDam »

AFTER_EDITING(oBrowse)
oCol = oBrowse:getcolumn(oBrowse:colPos)
cDataLink = VAR2CHAR(oCol:dataLink)
cFldName = STRTRAN(SUBSTR(cDataLink,AT(">",cDataLink) + 1),"}")
msgbox(cFldName)
return nil
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

User avatar
slobodan1949
Posts: 86
Joined: Mon Apr 25, 2011 8:57 am
Location: SERBIA
Contact:

Re: DCBROWSE AND MY PROBLEM

#3 Post by slobodan1949 »

Hvala Slavko.
Ovo mi je stvarno mnogo trebalo a nisam uspeo da provalim gde leži zec. Zadužio si me.

User avatar
rdonnay
Site Admin
Posts: 4807
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSE AND MY PROBLEM

#4 Post by rdonnay »

Here is another way you can store the field name in the XbpColumn object:

Code: Select all

DCBROWSECOL FIELD CUSTOMER->bill_name HEADER 'Billing Name' WIDTH 25 PARENT oBrowse ;
   EVAL {|o|o:_fieldname := 'BILL_NAME'}

DCREAD GUI EVAL {||(wtf oBrowse:getColumn(1):_fieldName}
You can assign any new variable to the column object. It is stored as a NOIVAR.
I recommend preceding the variable name with an underscore so as not to overwrite any exported variables already defined in the DC_XbpColumn class.
The eXpress train is coming - and it has more cars.

User avatar
slobodan1949
Posts: 86
Joined: Mon Apr 25, 2011 8:57 am
Location: SERBIA
Contact:

Re: DCBROWSE AND MY PROBLEM

#5 Post by slobodan1949 »

Thanks Roger,
this method works well.

Post Reply