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.
Retrieve value of DCGET object in called function
-
- 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
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.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
-
- 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
Roger, is this equivalent to your sample.
Code: Select all
DC_GetObject(aMainGetlist,'TOTACHAMT1'):getdata() pause
Re: Retrieve value of DCGET object in called function
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.
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.
-
- 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
Yes, your sample provided valuable insight into the use for myself and others on the webboard.