home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.informix
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!kronos.arc.nasa.gov!iscnvx!netcomsv!firewall!mlee
- From: mlee@adaclabs.com (Mike Lee )
- Subject: Re: Informix 4GL arrays
- Message-ID: <1992Nov17.193900.6379@adaclabs.com>
- Sender: usenet@adaclabs.com
- Nntp-Posting-Host: 192.153.52.149
- Organization: Adac Laboratories, Milpitas Ca
- References: <1do0gjINNilu@emory.mathcs.emory.edu>
- Date: Tue, 17 Nov 1992 19:39:00 GMT
- Lines: 76
-
- Aaron Pelton writes:
- >
- > In my quest for the answer to Informix vs Progress I've come across
- > a particular area, scrolling data on the screen, that Informix doesn't
- > seem to handle well.
- Not true! Not true I say 8^)
-
- > Given that I have a set of data that may be anywhere from 0 to n records
- > that I want to place in a scrolling region on the screen, can it be done
- > without a LOT of code to accomplish this?
-
- There are few different ways to display scrolling information...
- Assuming all you want to do is select information from a table and display
- in a window that allows a user to scroll through and see the choices, this
- is what I would do.
-
- Define an array to the size you want.
- DEFINE
- test_arr ARRAY[50] OF RECORD
- last_name
- END RECORD
-
- Open your window with a form that has been defined as an array. Something
- like this:
- [f1 ]
- [f1 ]
- [f1 ]
- [f1 ]
- [f1 ]
- [f1 ]
- .
- .
- .
-
- INSTRUCTIONS
- SCREEN RECORD scr_array[10]
- (
- FORMONLY.last_name
- )
-
-
- Declare and Foreach each record into your array incrementing x
-
- DECLARE c1 CURSOR FOR
- SELECT last_name
- FROM names
- ORDER BY last_name
-
- FOREACH c1 INTO test_arr[x].last_name
- let x = x + 1
- END FOREACH
-
- LET x = x - 1
- CALL set_count(x)
-
- DISPLAY ARRAY test_arr TO scr_array.*
-
- That's all you need to display scrolling information. The user can scroll
- down the information. If they want to select a value they can press the
- ESC key to select the value by adding the following code.
-
- IF (int_flag = FALSE) THEN
- let choice = arr_curr()
- RETURN pop_phy_arr[choice].last_name
- END IF
-
- I hope I read the question correctly, if not, send me some email...
-
- Good Luck...
-
- ________________________________________________________
- ________| Mike Lee | I like pigs. Dogs look up to us. |_______
- \ | ADAC Laboratories | Cats look down on us. Pigs treat | /
- \ | mlee@adaclabs.com | us as equals. - Churchill | /
- / |________________________________________________________| \
- /__________) (_________\
-