arr_count, set_count help needed
Posted in 1996
Using Informix 4.* and programming in 4gl, I have run into a couple of problems and am looking to some gurus for assistance. These problems all deal with the use of "SET_COUNT" and "ARR_CURR". What variables do these functions report on? How can we update them on the fly? [Also, unrelated, If an "On Key" will cause Informix to bypass the key's normal function, then how can we call what it normally does? I.e. -- "On Key (Up)" should normally take you to the next record. If want to turn this function off at certain times, depending on array element features, how can I test the array (I know... an IF statement) and then tell Informix to get Next record depending on the results???] Here are the issues: 1) I have a "Display Array". I would like to be able to insert records and delete records from this array. My work-around is to close the array, perform the array adjustments, and then re-open the Display with a new "set_count" call informing it of the new number of array elements. However, this will position the internal Diaply Array cursor at the first array element. I would like to reposition this cursor to the array position where the modification took place. This means adjusting the ARR_CURR variable. How? 2) I have an Input array. The user decides to Insert a row into the middle of the array, but then decides they don't really want it. They NULL out 2 important fields, and I check for this. I get rid of the empty row (array[x].*=array[x+1].* through the rest of the array), and NULL out the final record. However, Informix looks at this last record as a NULL record in the array because it's "SET_COUNT" variable was automatically incremented. How can I decrement this variable (without closing and re-opening the Input Array) so Informix looks at only the true existing elements of the array? 3) I have an Input Array. I am inserting a row and hit the "NextPage" Key. This causes Informix to bypass the After Insert and After Row sections. How can I stop this? 4) In the After Row section, I do some testing of the fields. If they fail, I say "Next Field [x]", but Informix puts me in [x] in the NEXT RECORD! How can I tell Informix to stay on the current record? That's all for now. Thanks for whatever help you can give me! Michael Hoffman