Retrieve value of DCGET object in called function

This forum is for eXpress++ general support.
Post Reply
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Retrieve value of DCGET object in called function

#1 Post by Cliff Wiernik »

I have a DCGET xvariable setup in a dialog. Sometimes it might be a DCGET bBlock construct. One of the processes on the dialog calls a function that needs access to the xvariable or the value represented by the result of the bBlock codeblock.

Is there a way, if you have access to the Getlist and know the GETID value, to retrieve the actual value of DCGET without passing the individual variables or bBlock values. The function does many things and different variable needs may appear from time to time. I don't want to continue to pass additional variables as I already am passing the getlist.

Plus it would be nice if the returned value was in the actual type of the getvalue variable or bBlock result.

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

Re: Retrieve value of DCGET object in called function

#2 Post by rdonnay »

Code: Select all

cID := 'MYFIRSTGET'

nElement := AScan(GetList,{|a|a[cGETLIST_ID]==cID})

bVar := GetList[nElement,bGETLIST_VAR]

xValue := Eval(bVar)
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Retrieve value of DCGET object in called function

#3 Post by Cliff Wiernik »

Thanks.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Retrieve value of DCGET object in called function

#4 Post by Cliff Wiernik »

Roger, is this equivalent to your sample.

Code: Select all

DC_GetObject(aMainGetlist,'TOTACHAMT1'):getdata() pause

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

Re: Retrieve value of DCGET object in called function

#5 Post by rdonnay »

Yes, it is equivalent to the other lines of code.
There are a lot of ways to get that info.
I thought that my sample would give you a little more understanding of the structure of the GetList.

Your method is probably the best one.
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Retrieve value of DCGET object in called function

#6 Post by Cliff Wiernik »

Yes, your sample provided valuable insight into the use for myself and others on the webboard.

Post Reply