Re: Window name in a variable
Posted in 1997
Jacob Salomon wrote: >... > In 4GL, is there any way for a window name to be held as a string value > in a char variable? Here is the code that is failing at run time: > > 107 function set_cur_window(wname) > 108 define wname char(10) > 109 current window is wname > 110 let cur_win_name = wname > 111 end function > > The run time error is: > > Program stopped at "main.4gl", line number 109. > FORMS statement error number -1147. > You cannot CLOSE, CLEAR or make CURRENT an unopened window. > > Which is preety reasonable, considering that there is no window called > "wname". > > I freely admit this was an experiment; since it failed, I will have to > go back to the obvious alternative; a big case statement that will have > to maintained. The case statement is the only solution we've found. In Power-4gl, all window handling statements are handled by basic functions with big case statements. This has the benefit of being able to add features like variable window names and error handling. E.g. if the window doesn't fit on the screen at the specified location the function changes the location automatically (moving it up and left) until it does. The case statement is ugly but is packaged and hidden from the general coding of applications - it works. ---------------------------------------------------------------------- John H. Frantz Power-4gl: Extending Informix-4gl frantz@centrum.is http://www.rl.is/~john/pow4gl.html