Displays the contents of the specified list.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X   X


expr list_view3(list-name,row,col,size,abort-key,
list            list-name
int             row,col,size,abort-key,options,ret-col
expr            view-col


Returns the value in ret-col for the selected item.
list-name specifies the list.

row specifies the row position for the displayed window. -1 places the upper left of the box at the cursor position. -2 places the box in the center of the screen.

col specifies column location of the view box; -1 places the upper left of the box at the cursor position. -2 places the box in the center of the screen.

size specifies the number of rows to display; if it is -1, the function displays as many rows as will fit.

view-col (optional) specifies which columns to display. Please refer to list_view's definition of view-col for more details. The default is all columns.

abort-key if greater than zero, specifies the key that can be used to cancel the function's operation (returns NULL).

options define how the list is to be displayed. The values are defined in trim.h.
opt_vertical vertical list layout
opt_horizontal horizontal list layout
opt_highlight current item highlighted
opt_browse browse mode
opt_keepopen leave list window open
opt_noinput just show the list
opt_fixfont use fixed font (GUI only)
opt_report report style list (GUI only)
opt_buttons display user buttons

ret-col the absolute zero-based column position of the data to be returned.


list_view3() includes the same scrolling capabilities as list_view2() and list_view() with the addition of an ``abort'' feature. If the end user cancels the operation, this function restores the current item. In addition, you can define display options for your end user and specify the column to return.

See list_colaux to force column formatting.


Creates a file-editing prompting utility:

  list    files;
  string  fn[80];
  string  fn2[80];
  int     cnt;

  fn = tmpnam();
  system("ls > " ^^ fn);
  files = list_open(fn,1000,"Hit Enter to edit a file, F3 to quit");
  while (true) {
    fn2 = list_view3(files,5,5,10,key_f3,opt_highlight,0);
    if (fn2 == NULL) break;
    system("vi " ^^ fn2);