Re: Updating screen rows in INPUT ARRAY
Posted in 1996
Con Woodall wrote: > > On 1 Apr 1996, Richard Spitz wrote: > > } ... > } > } How can I change the code so all rows for that date are updated on the > } screen? I've done this in other programs by embedding the INPUT ARRAY > } in a WHILE loop, exiting the INPUT array session, updating the data > } and loop back into the INPUT array. The problem is putting the cursor > } back to the row that was just being processed, and the kludgy solution > } to this (working with a NOENTRY field/NEXT field combination) was not > } liked by the users. > } > ... You should be able to display > your changed data without leaving the input array. > ... What I don't know about is what happens to those rows which you > do not re-display at that time. After the update you describe, will they > display properly as you scroll up or down to them? Yes. So long as the entire array is updated properly, it doesn't matter whether or not the array is DISPLAYed prior to scrolling for it to be updated. In other words, the screen buffer doesn't have anything to do with the array, and you're updating the array memory, so values are appropriate. Remember that if you allow changes to PRIMARY KEY values, you'll have to make sure to save the prior PK in another array or something, so you can properly update the database (probably via DELETE ... INSERT as opposed to UPDATE). If there are other reasons that using the NEXT FIELD ... NOENTRY trick is unsatisfactory, you'll probably be forced to use the "Save rows in a TEMP table and use INPUT ARRAY on an array sized to the screen" trick, which means you have to code your own INSERT/DELETE/NEXT/PREVIOUS/etc functionality, which isn't as bad as it might seem, since I believe I posted some generic code for it some time ago in the FAQ. If you can't find it, let me know and I'll dig it out. //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 5299 DTC Blvd Suite 740 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-843-6408 and do not necessarily //////////////// http://www.informix.com reflect those of my employer