Browse through a Temp Table Buffer handle in UNIX CHUI Interface

Sundreamz

New Member
Hi Friends,

I am attempting to create a dynamic browse in CHUI UNIX( Progress 10.0B) environment that will display the contents of the temp table buffer handle.
In windows <Browse Handle>:add-columns-from(<Buffer Handle>) can be used to generate a buffer. But this cannot be used in UNIX CHUI. Is there anyway this can be achieved in CHUI?
If its not possible then then the only option I have to make the temp table and define browse for that!!!!

Here is what I am attempting to do!!!

define variable hTempTable as handle.
define variable cntr as int.
define variable FieldList as char init
"name,city,state".
define variable TableName as char init "customer".
create temp-table hTempTable.

do cntr = 1 to num-entries(FieldList):
/* The first expression will be tname,
the second, customer.name */
hTempTable:add-like-field(
"t" + entry(cntr,FieldList),
TableName + "." + entry(cntr,FieldList)).
end.

/* Now freeze the structure of the temp table */
hTempTable:temp-table-prepare("t" + TableName).

FOR EACH customer WHERE cust-num < 5:
define variable hTTBuffer as handle.
define variable hField as handle.

hTTBuffer = hTempTable:default-buffer-handle.
hTTBuffer:buffer-create().

hField = hTTBuffer:buffer-field("tname").
hField:buffer-value = CUSTOMER.NAME.

hField = hTTBuffer:buffer-field("tcity").
hField:buffer-value = CUSTOMER.city.

hField = hTTBuffer:buffer-field("tstate").
hField:buffer-value = CUSTOMER.state.

END.


DEFINE VARIABLE hQuery AS HANDLE.
define variable hBrowse as handle.

create browse hBrowse.

create query hQuery.
hTTBuffer = hTempTable:default-buffer-handle.
hQuery:set-buffers(hTTBuffer).

hQuery:query-prepare("for each " + hTempTable:name).

hBrowse:query = hQuery.

/* Add all the columns from the buffer */
hBrowse:add-columns-from(hTTBuffer).

hQuery:query-open().
hBrowse:visible = yes.
apply "home" to hBrowse.
apply "entry" to hBrowse.

Can someone advice me how can I achieve the same on CHUI? Or do I have to resort to shared temp tables?

Thanks in Advance.....

Rgds,
Sundreamz
 
Top