Re: Input Array
Posted in 1992
Quoting steve... > > I have a screen array with 15 elements, and a corresponding > record array of 15 elements. The record array does not necessarily > have all 15 elements filled. Ideally I want to use Input Array to allow > the user to overkey some of the fields in the record array, while at > the same time preventing them from inserting rows if the record-array > is currently not full. Deletion of rows is also not permitted. > However there seems to be no way of denying access to the empty rows > at the end of the array. It also seems that the only way to disable the > INSERT and DELETE function keys is to use the options statement to > assign them to some non-existent keys, but this seems like a hack. First, do this... OPTIONS INSERT KEY CONTROL-Q OPTIONS DELETE KEY CONTROL-Q This will disable the INSERT and DELETE keys. Next you're going to have to use fgl_lastkey() and fgl_keyval(). You do know how many records are in the array (how would you do a set_count() if you didn't). Anyway after every field in the INPUT ARRAY statement you need to see if you are on the last row (compare the return value of arr_curr() to what you passed set_count()). If you are on the last row in any field except the last, you have two invalid keys: DOWN and NEXTPAGE. If you are on the last row in the last field, you have four valid keys: UP, LEFT, PREVPAGE, and ACCEPT. This is why you'll need fgl_lastkey() and fgl_keyval(). DAS -- David A. Snyder @ Snide Inc. - Folcroft, PA Current Release is db4glgen-3.5 UUCP: ..!uunet!das13!dave INTERNET: dave.snyder@snide.com