Re: Help for handle "Input Array"
Posted in 1998
Try something like this in your the "after field" # m_p_curr: current element of the program array # m_s_curr: current element of the screen array # m_num_recs: number of elements in the program array # m_screen_arr: size of the screen array after field weight let m_p_curr = arr_curr() let m_s_curr = scr_line() # si estoy en la ultima linea y trata de bajar mas if m_p_curr = m_num_recs and ( fgl_lastkey() = fgl_keyval("return") or fgl_lastkey() = fgl_keyval("down") or fgl_lastkey() = fgl_keyval("tab")) then # evito que 4gl abra una nueva linea # 288: You have reached the last authorized line let g_scratch = get_message(288) error g_scratch clipped next field weight end if # si trata de bajar una pagina y con ello excede la ultima if fgl_lastkey() = fgl_keyval("nextpage") and (m_p_curr + m_screen_arr) > m_num_recs then # evito que 4gl abra una nueva linea # 288: You have reached the last authorized line let g_scratch = get_message(288) error g_scratch clipped next field weight end if In this example I have an "input array" of only one field. If you have a lot of fields it's better to put the all the validations in a separate function. The check for the "return" and "tab" keys should be only in the last field of the record. CheungYip San wrote: > Hello all informix 4GL users, > > I am writing the Informix 4GL program and try to > using the "Input Array" to display and modify the > program array on the screen. > > But I don't know how to control the program to stay > on the last item of program array. Since the cursor > will move to a new blank row after the user press > the <Down> or <Enter> key at the last containing > data row. > > This program just only use to modify the existing > data, I won't want the user to insert any new > row to the array. > > Thank for all if you know how to help me. > > Earnest