@Layout
Describes the layout of a screen or report: Label, Input, Column, DataGridView, Block, or any other Name(...) as a generic control. Control names may carry @ optionally (@Label/Label are equivalent).
Controls with their own grammar
| Control | Syntax | Valid in | Description |
|---|---|---|---|
Label | Label(x, y, text) | Program, Screen | Static label at x,y. text can be &Variable, "literal" or a bare field name. x,y = 1,1 (exact corner) is forbidden — DDS rejects any field there. |
Block | Block("Name")[ Label(...), ... ] | Program | A named, printable group of Labels — an instance is printed with Print("Name") from @Source. |
Input | Input("Name", x, y, text, &Variable[, enabled]) | Screen | Editable field at x,y. "Name" identifies the control (read with CurrentInput()). &Variable is where the entered value is stored. enabled optional (default true): a literal, &Variable or a function returning number (non-zero = enabled), re-evaluated before every redraw. x,y = 1,1 is also forbidden. |
Column | Column(text, variableOrField[, Input|Hidden]) | inside DataGridView only | The optional 3rd argument makes the column editable (Input) or invisible (Hidden). |
DataGridView | DataGridView("Name", x, y, rows[, separator])[ Column(...), ... ] | Screen | A named grid at x,y showing rows visible rows. The name is required and unique among Input/DataGridView controls. See DataGridView for the full guide. |
Example (Screen)
@Layout {
@Label(1,2,&Program)
@Label(1,70,&MyDate)
@Input("txtRequestNo",3,1,"Request No.: ",&RequestNo,true)
@DataGridView("GridRequests",6,1,8," ") [
@Column("Country",&nCountry)
@Column("User",&cUser)
]
}
Example (Program, with a printable Block)
@Layout {
@Block("Header") [
Label(1,1,"Sales Report")
Label(2,1,&Today)
]
}
@Source {
Print("Header")
}
@Layout is optional in Program (a purely batch program, with no printed output, doesn’t need it) but required in Screen. Doesn’t apply to tables.