Sub-Scheda
How use Sub-Scheda
The Scheda itself is also a component, and we can create Sub-Scheda that can be reused multiple times. Additionally, creating Sub-Scheda allows us to maintain cleaner and more organized code, especially in the case of overly lengthy Scheda.
A Subscheda has a defined start and end that delimit its boundaries, and it includes an identifying name for easy reference. This allows the Subscheda to be easily called upon in multiple locations within the code. The entire Subscheda can be reused, promoting modularity and reducing redundancy in your codebase.
::I.SCH Nam(<sub-scheda-name>)
<sub-scheda content>
::I.SCH.END
You can invoke the Subscheda wherever needed using the standard component syntax
::G.SUB.SCH Tit="*NONE"
::D.SCH Nam(<sub-scheda-name>)
Otherwise from another scheda by employing a FUN that references the name of the .sch
file containing the Subscheda and the name of the Subscheda itself.
F(EXD;*SCO;) 2(MB;SCP_SCH;<scheda-name>) 4(;;<sub-scheda-name>)
By assigning a parameter G(<value>)
to the FUN, you can open scheda-subscheda in different modes:
G(NFI)
: Opens the subscheda in a new window.G(NFIR)
: Opens the subscheda in a reduced new window.G(PNLT)
: Opens slider panel topG(PNLR)
: Opens slider panel rightG(PNLL)
: Opens slider panel leftG(PNLB)
: Openw slider panel bottom
For example, this FUN opens a modal dialog:
F(EXD;*SCO;) 2(MB;SCP_SCH;<scheda-name>) 4(;;<sub-scheda-name>) G(NFIR)
Example
::I.SCH Nam(TEST)
::G.SEZ Pos(1)
::G.SUB.LAB Tit="*NONE"
::D.OGG D(Hello World!)
::I.SCH.END