home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / informix / 2454 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.5 KB  |  89 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!kronos.arc.nasa.gov!iscnvx!netcomsv!firewall!mlee
  3. From: mlee@adaclabs.com (Mike Lee )
  4. Subject: Re: Informix 4GL arrays
  5. Message-ID: <1992Nov17.193900.6379@adaclabs.com>
  6. Sender: usenet@adaclabs.com
  7. Nntp-Posting-Host: 192.153.52.149
  8. Organization: Adac Laboratories, Milpitas Ca
  9. References: <1do0gjINNilu@emory.mathcs.emory.edu>
  10. Date: Tue, 17 Nov 1992 19:39:00 GMT
  11. Lines: 76
  12.  
  13. Aaron Pelton writes:
  14. >     In my quest for the answer to Informix vs Progress I've come across
  15. > a particular area, scrolling data on the screen, that Informix doesn't
  16. > seem to handle well.
  17. Not true! Not true I say 8^)
  18.  
  19. >    Given that I have a set of data that may be anywhere from 0 to n records
  20. > that I want to place in a scrolling region on the screen, can it be done
  21. > without a LOT of code to accomplish this?
  22.  
  23. There are few different ways to display scrolling information...
  24. Assuming all you want to do is select information from a table and display
  25. in a window that allows a user to scroll through and see the choices, this
  26. is what I would do. 
  27.  
  28. Define an array to the size you want.
  29.     DEFINE
  30.         test_arr ARRAY[50] OF RECORD
  31.             last_name
  32.         END RECORD
  33.  
  34. Open your window with a form that has been defined as an array. Something
  35. like this:
  36.     [f1        ]
  37.     [f1        ]
  38.     [f1        ]
  39.     [f1        ]
  40.     [f1        ]
  41.     [f1        ]
  42.     .
  43.     .
  44.     .
  45.     
  46.     INSTRUCTIONS
  47.         SCREEN RECORD scr_array[10]
  48.             (
  49.             FORMONLY.last_name
  50.             )
  51.     
  52.  
  53. Declare and Foreach each record into your array incrementing x
  54.  
  55.     DECLARE c1 CURSOR FOR
  56.         SELECT last_name
  57.         FROM names
  58.         ORDER BY last_name
  59.  
  60.     FOREACH c1 INTO test_arr[x].last_name
  61.         let x = x + 1
  62.     END FOREACH
  63.  
  64.     LET x = x - 1
  65.     CALL set_count(x)
  66.  
  67.     DISPLAY ARRAY test_arr TO scr_array.*
  68.  
  69. That's all you need to display scrolling information.  The user can scroll
  70. down the information. If they want to select a value they can press the
  71. ESC key to select the value by adding the following code.
  72.  
  73.     IF (int_flag = FALSE) THEN
  74.         let choice = arr_curr()
  75.         RETURN pop_phy_arr[choice].last_name
  76.     END IF
  77.         
  78. I hope I read the question correctly, if not, send me some email...
  79.  
  80. Good Luck...
  81.  
  82.          ________________________________________________________
  83. ________| Mike Lee           | I like pigs. Dogs look up to us.  |_______
  84. \       | ADAC Laboratories  | Cats look down on us. Pigs treat  |      /
  85.  \      | mlee@adaclabs.com  | us as equals. - Churchill         |     /
  86.  /      |________________________________________________________|     \
  87. /__________)                                                  (_________\
  88.