var handle hwwin, hwfrm, hwbr, ht, hb, hq, hp.
var handle [2] hwcol.
function createRow logical private (
i_hb as handle,
i_ii as int,
i_cc as char
):
i_hb:buffer-create().
assign
i_hb::id = i_ii
i_hb::description = i_cc
.
end function.
create temp-table ht.
ht:add-new-field( 'id', 'int64' ).
ht:add-new-field( 'description', 'character' ).
ht:temp-table-prepare( 'dynamic' ).
hb = ht:default-buffer-handle.
createRow( hb, 1, 'one' ).
createRow( hb, 2, 'two' ).
createRow( hb, 3, 'three' ).
createRow( hb, 4, 'four' ).
create window hwwin assign
width = 100
height = 20
status-area = false
message-area = false
visible = true
.
create frame hwfrm assign
parent = hwwin
width = hwwin:width
height = hwwin:height
visible = true
.
create query hq.
hq:add-buffer( hb ).
hq:query-prepare( substitute( 'for each &1', hb:name ) ).
create browse hwbr assign
frame = hwfrm
query = hq
width = hwfrm:width - 1
height = hwfrm:height - 1
visible = true
sensitive = true
.
hwcol[1] = hwbr:add-like-column( hb:buffer-field( 'id' ) ).
hwcol[2] = hwbr:add-like-column( hb:buffer-field( 'description' ) ).
hp = this-procedure.
on row-display of hwbr persistent run RowTrigger in hp ( hwbr:query, hwcol ).
hq:query-open().
wait-for close of hwwin.
procedure RowTrigger:
define input parameter i_hq as handle no-undo.
define input parameter i_hwcol as handle no-undo extent.
var handle hb.
var int ix.
if valid-handle( i_hq ) then do:
hb = i_hq:get-buffer-handle(1).
if valid-handle( hb ) then do:
do ix = 1 to extent( i_hwcol ):
i_hwcol [ix]:bgcolor = 13 + ( hb::id modulo 2 ).
end.
end.
end.
end procedure.
Once you change all of theThanks a Lot!!! With the code you sent, I have managed to do what I want!
This code is OpenEdge 12.8? (I am in OpenEdge 12.2)
var ...
statements to define variable ...
statements, it will compile in 12.2.I'm not sure what you mean by this. What is faster than what? Can you provide an example of what you mean?In Openedge 12.8 it is faster to define variables.
And more importantly it means I can leave out no-undo clutter without getting scoldedYes, already done that. In Openedge 12.8 it is faster to define variables.
3 letters vs at least 7 (d-e-f-<space>-v-a-r)I'm not sure what you mean by this. What is faster than what? Can you provide an example of what you mean?
Also multiple variables of the same type on one line and more concise extents, my two lines above would need to be the following pre-var:I'm not sure what you mean by this. What is faster than what? Can you provide an example of what you mean?
define variable hwwin as handle no-undo.
define variable hwfrm as handle no-undo.
define variable hwbr as handle no-undo.
define variable ht as handle no-undo.
define variable hb as handle no-undo.
define variable hq as handle no-undo.
define variable hp as handle no-undo.
define variable hwcol as handle no-undo extent 2.
var handle hwwin, hwfrm, hwbr, ht, hb, hq, hp.
var handle [2] hwcol.
Look on the bright side, you aren't supporting 10.1B.Oh, if only I could drop support for 12.2![]()
Also multiple variables of the same type on one line and more concise extents, my two lines above would need to be the following pre-var:
Code:define variable hwwin as handle no-undo. define variable hwfrm as handle no-undo. define variable hwbr as handle no-undo. define variable ht as handle no-undo. define variable hb as handle no-undo. define variable hq as handle no-undo. define variable hp as handle no-undo. define variable hwcol as handle no-undo extent 2.
I prefer the two-liner:
Code:var handle hwwin, hwfrm, hwbr, ht, hb, hq, hp. var handle [2] hwcol.
Oh, if only I could drop support for 12.2![]()