BROWSE2D()
Short:
------
BROWSE2D() Popup tbrowse of 2 dimension array (array of arrays)
Returns:
--------
<nSelection> => selected item, 0 if none
Syntax:
-------
BROWSE2D(nTop,nLeft,nBottom,nRight,aArr,[aHead],[cColor],;
[cTitle],[bExcept])
Description:
------------
Pops up a box at <nTop,nLeft,nBottom,nRight> and
tbrowses array contained in <aArr>.
<aArr> must be a 2 dimensioned array, like the ones
returned from DIRECTORY() or DBSTRUCT().
i.e. { array(n),array(n),array(n) } where <n> is the
same length for each subarray.
[aHead] an array of column headers matching the
number of elements in a single subarray of <aArr>. Default is
none.
[cColor] popup box color. Default is sls_popcol()
[cTitle] title string for the box. Default is none.
[bExcept] is a codeblock that will be evaluated for
any exception keys - any keys other than up/ down/ right/ left/
pgup/ pgdn/ home/ end/ enter/ esc. [bExcept] will be passed the
parameters: key value, tbrowse object, element
Examples:
---------
proc test
local a := directory()
browse2d(5,5,20,40,a, ;
{"File","Size","Date","Time","Attribute"},,"Choose a File")
use customer
a := dbstruct()
browse2d(5,5,20,40,a,nil,nil,nil,;
{|k|msg(str(k)+" is not a valid key")})
// note the exception block
Source:
-------
S_2DBRZ.PRG