Ask Reuben
Adding a Blank Line in a GRID
How can I add a blank line in a GRID?
In my recent discussion posts on the GUI Debug Grid, if you had followed the links and read the documentation and in particular this page you may observed that the grid illustration had an empty row/line between First Name and Last Name fields
… yet in the rendered screenshot in the documentation, there is no empty row/line between First Name and Last Name …
… point 4 in the documentation above those images has the statement “Empty lines and empty columns in the form layout definition take a size of 0 pixels.”. So that is why if you leave an empty row/line in your grid with a .per such as
First Name [f01 ] Last Name [f02 ]
you will find that blank row/line does not exist in the rendered form. So that creates todays question of “How can I add a blank line in a Grid?”.
The solution is to ensure that the line/row is not empty, and the way to do that is to add something that cannot be seen. That consists of a LABEL that has a TEXT attribute value of zero or more spaces. So using the above example, this can be achieved rudimentarily with …
First Name [f01 ] [""] Last Name [f02 ]
or if you’d like a more complex example …
LAYOUT (TEXT="Empty Row Example") VBOX GROUP (TEXT="Empty Row Collapses") GRID { No blank row beneath this row No blank row above this row } END END GROUP (TEXT="Non-Empty Row Remains") GRID { Blank row beneath this row [""] Blank row above this row } END END GROUP (TEXT="Non-Empty Row Remains Using Explicit Label") GRID { [l01 ] [l02 ] [l03 ] } END END END END ATTRIBUTES LABEL l01: TEXT="Blank row beneath this row"; LABEL l02: TEXT=""; LABEL l03: TEXT="Blank row above this row";
… that previews as …
If we look in the Debug Tree, we can see that a Label element is created for [“”].
So in summary if you want to force a blank line in your Grid, simply add an empty Label to this line.