Re: INPUT ARRAY question
Posted in 1993
cm415a06@socrates.umd.edu (Michael Heaney) writes: >Using the INPUT ARRAY feature of INFORMIX, I can detect the current >screen array row that the user has moved the cursor to by using the >scr_line() function, and what the corresponding data array entry is >with the arr_curr() function. >I can also display any data array values to any screen array rows using >the DISPLAY statement (for example, detect within the INPUT ARRAY that >the user wants to go to the data beginning with the letter 'S', then >finding the starting point in the data array and displaying from there >forward to the screen until the screen is re-painted with data beginning >with 'S'). >But...how do you then tell INFORMIX that the user is on screen line 1 >(so that the next scr_line() call will return 1) and that the current >data array position is changed? The only way I've ever been able to figure out is to leave the INPUT ARRAY statement and enter it again. I usually use two arrays, one that holds all values and one that holds only 1 screens' worth. This takes quite a bit of coding, but I'll offer a simplified overview: # call a function that fills the screen array from the big array CALL fill_scr_array(1) # set a flag to let us know we're jumping into the input array LET inp_arr = TRUE WHILE inp_arr LET inp_arr = FALSE INPUT ARRAY ... FROM ... ... ON KEY (The key to jump to another row) LET inp_arr = TRUE # call the function to fill the screen array appropriately CALL fill_scr_array(array number determined to be the one) EXIT INPUT ... END INPUT END WHILE ... Let me know if you need a more detailed example. ================ Dennis J. Pimple Informix CSE / Denver