[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DEFINE WINDOW example FROM 4, 3 TO 21,76 TITLE ' List Example ' ;
        FLOAT CLOSE SHADOW SYSTEM COLOR SCHEME 8

*** Fill the array cityarray with city data ***
SELECT DISTINCT city FROM customer INTO ARRAY cityarray
SELECT customer

*** Define a popup that contains the structure of customer ***
DEFINE POPUP popstru PROMPT STRUCTURE SCROLL MARGIN MARK CHR(16)

*** Define a popup that contains the data from the company field ***
DEFINE POPUP popfield PROMPT FIELD company SCROLL MARGIN MARK CHR(16)
ACTIVATE WINDOW example
@ 1,3 SAY 'Structure Popup:'

*** Get information using predefined popstru popup ***
@ 2,2 GET liststructure POPUP popstru SIZE 11,20;
  DEFAULT FIELD(1,'customer') WHEN refresh();
  VALID dispitem(liststructure) COLOR SCHEME 9
@ 13,3 SAY liststructure SIZE 1,18
@ 1,26 SAY 'Field Popup:'

*** Get information using predefined popfield popup ***
@ 2,25 GET listfield POPUP popfield SIZE 11,20 ;
        DEFAULT company WHEN refresh() VALID dispitem(listfield);
        COLOR SCHEME 9
@ 13,26 SAY listfield SIZE 1,18
@ 1,50 SAY 'Array of City Names:'

*** Get information using predefined array ***
@ 2,49 GET arrayitem FROM cityarray SIZE 11,20 ;
        DEFAULT cityarray(1) WHEN refresh() VALID dispitem(arrayitem);
 COLOR SCHEME 9
@ 13,50 SAY arrayitem SIZE 1,18
@ 14,63 GET ok FUNCTION '*t \!OK' DEFAULT 1 SIZE 1,6
READ CYCLE SHOW popshow()  && Activate gets
RELEASE WINDOW example
RELEASE POPUPS popstru, popfield

FUNCTION refresh
*** Refresh window information without calling subroutine ***
SHOW GETS OFF

FUNCTION dispitem
*** Display which item has been chosen ***
PARAMETER item
WAIT WINDOW 'You have chosen: '+ALLTRIM(item) NOWAIT

FUNCTION popshow
*** Display current items for each list ***
@ 13,3 SAY liststructure SIZE 1,18
@ 13,26 SAY listfield SIZE 1,18
@ 13,50 SAY arrayitem SIZE 1,18

-----------------------------------

See Also:  @ ... SAY/GET, DEFINE POPUP, OBJNUM(), SHOW GETS,
USER-DEFINED FUNCTIONS (UDFs)

-----------------------------------

See Also: @ ... SAY/GET DEFINE POPUP OBJNUM() SHOW GETS
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson