09.03.2015 Views

An IVIB Primer - Unicon

An IVIB Primer - Unicon

An IVIB Primer - Unicon

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

table_1_col_select := 0<br />

return<br />

}<br />

if \ev & \ev.source & \ev.type & \ev.param then<br />

.......<br />

........<br />

end<br />

Add the following to methods to handle the events. These methods Sort the selected columns:<br />

#____________________________________<br />

method on_table_column_1()<br />

local lst,k,slst ,T<br />

lst := []<br />

slst := []<br />

table_1_col_select := 1<br />

lst := table_1.get_contents()<br />

T := table()<br />

every k := 1 to *lst do<br />

insert(T,lst[k][1],lst[k][2])<br />

lst := []<br />

lst := sort(T,1)<br />

table_1.set_contents(lst) # sort by table key<br />

end<br />

#____________________________________<br />

method on_table_column_2()<br />

local lst,k,slst ,T<br />

lst := []<br />

table_1_col_select := 1<br />

lst := table_1.get_contents()<br />

T := table()<br />

every k := 1 to *lst do<br />

insert(T,lst[k][1],lst[k][2])<br />

lst := []<br />

lst := sort(T,2) # sort by table elements<br />

table_1.set_contents(lst)<br />

end<br />

#___________________________________________<br />

Compile and run. When you click on the table columns, they should sort by Name or number of players. This<br />

demonstrates the use of table columns.This concludes this Tutorial.<br />

42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!