palmtree with sun behind it CONTACT US
Phone: (412) 835-9417
Email: sales@vss3.com

Tip #36 - LISTBOX and @KEYF

Using Listbox can off a choice of selections to the user that can be easy to use.  First create an array and load the possibilities in the array.  Our array will be used to select the forms available to be printed from Daily Input.  The forms are created and may have processing that would have the same name as the form.

88 ------- - - - - - - - - - - - - - - - -
@keyf If: 'Print a form
   Then: dim items(3)(10);        'use (10) to define the number of characters in each element (the width)

90 ------- - - - - - - - - - - - - - - - -
If:
   Then: items("1")="invoice";items("2")="order";items("3")="statsh"
89 - - - - - - - - - - - - - - - - - - - - - - - - - -
If:
   Then: fx(2,.0)=listbox(items)
90 ------- - - - - - - - - - - - - - - - -
If: fx ge "1" and fx le "3"
   Then: fr=items(fx){"";call fr

This calls to a process table which collects the information that is printed on the form    Then does a FORM "invoice" (if invoice is the form selected) to print the proper form. When the END is executed in the called table it will return to this spot in the logic. This assumes that you will always have a process table that will handle the form and processing.  If you want to use this logic in a situation where the process existance is iffy, use the EXISTS() function to make sure the process exists before executing a CALL.

91 ------- - - - - - - - - - - - - - - - -
If:
   Then: end

LISTBOX has the nice feature that typing the initial letter of the selection will move the cursor to that selection.  There are many options to help customize the LISTBOX.

LISTBOX ( arrayname, first_element, last_element, row, column, height, width, initial_highlight )

arrayname required - name of array to be displayed
first_element first element to be displayed (assumed to be 1)
last_element last array element that should be included (assumed to be the highest element)
row Number of rows to displayed
column Number of positions to be displayed
height maximum height of box
width maximum width of box
initial_highlight location of highlight when first displayed. (great for repositioning on a repeat display)

 For example,

LISTBOX (items, "2","10",,,"10","40")  - display elements 2 to 10 of array called "items" in a box 10 high and 40 wide.  Screen location is up to filePro.

LISTBOX (items, , , "5","10") - display the listbox array called items, with the upper left corner at (5,10) on the screen.


Written by Nancy Palmquist

Copyright, 1997 by Virtual Software Systems.  All rights reserved.

Contact Us by: Email to Virtual Software Systems or Phone: (412) 835-9417