Formatting

From SysCAD Documentation
(Redirected from Labels)
Jump to navigation Jump to search

Navigation: PGMs ➔ PGM Programming and Conventions ➔ Formatting

PGM Syntax Data Types Declaring Variables Predefined Variables Formatting

Watch Keywords

Watch

Syntax:

Watch variable
Watch classInstance
Watch classInstance.DataMember

Special case uses of Watch:

NOTE: Although the Watch keyword can be used to display PGM code data variables in the Access window, the convention is to use the shortcut syntax when Declaring Variables, including variables within a user Class.

The Watch function:

  • Allows any variable to be displayed in the Access window as input fields. This is equivalent to appending a ' * ' to the end of the variable when Declaring Variables.
  • Allows any instance of a class to be displayed. This will add all the data members for the class.
  • Allows selective display of data members in a class instance. The Dot Notation would be used to access the required data member of the class instance.
  • When used with a ' @ ' after the variable, will display the variable as a result field in the Access window.
  • Any number of variables, class instances or class data members can be watched using a single watch command if each one is separated by a comma.

Examples:

REAL    a,b
Noise   x, y
WATCH   a, b@, x, y.StdDev

ExcludeWatch

Syntax:

ExcludeWatch UserClass[index]
  • This is used to make variables of a class instance not visible in the access window.
  • Further information with Class ExcludeWatch.

Example:

const long Count = 7
MyClass C[Count]
ExcludeWatch C[0]

Labels

PageLabel

Syntax available from Build 139.32335: PageLabel "string"
Syntax: PageLabel("string")

This is used to create a new access window tab page with the specified string.

For Example: PageLabel("Data") or PageLabel "Data"

  1. This will create a tab page with name "Data". (see example below)
  2. Use "" to enclose the label name.
  3. The Label length should not be too long. The maximum length allowed is 40 characters. Any characters over the maximum length will be trimmed.
  4. Within a Class definition, use ClassAsPageLabel to automatically create a tab page matching the variable name of each class instance.

TextLabel

Syntax available from Build 139.32335: TextLabel "string", "string"
Syntax: TextLabel("string", "string")

This is used to create text description lines on the access window.

  1. For a single comment: TextLabel(" Enter the feed options:") or TextLabel " Enter the feed options:"
  2. For a blank line: TextLabel(), TextLabel "" or simply TextBreak (available from Build 139.33027).
  3. To insert a text label with a blank line before the label, specify a comma before the label: TextLabel(, " Water Flows In") or TextLabel , " Water Flows In"
  4. You can specify multiple lines with comma (,) separator: TextLabel("" ," ======Alumina=======", " Area 5") or TextLabel "", " ======Alumina=======", " Area 5"
  5. Text Labels will appear on the access window as Italic text
Textlabel.png

Note: Do not use a tab in the string, it will be replaced with a single space.

TextBreak

Available from Build 139.33027.
Syntax: TextBreak

This is used without parameters to create a single blank line or text break between two sections. This is equivalent to TextLabel "".

Labels Example

This code will show the following Access Window view:

 
  PageLabel "Data"
  TextLabel , "  ---Inputs---"
  EnumDropList Options{Acid=2, Basic=4, Neutral}
  Options      OperatingMode*
  Checkbox     UsePredefinedValues*
  Real         Reqd_FeedSolids{i,("Frac", "%"),init(25),Range(0,100),Comment("Wt%")}
  Real         MFWashEff*("Frac","%")<0,100><<75>> ; Required Filter Wash efficiency.
  TextLabel , "  ---Results---"
  Long         Conditions@
  String       Message1@, SolutionCondition@
  Memo         WasherState@                        ; WasherState Message String
  Real         Energy@("E","kJ")         
  Real         Power@("Pwr","kW")           
  Real         Pressure@("P","bar")          
  Real         Temperature@("T","C")        
  Real         Simulation_Time@("Time","h")
PGM declareVar1.png

Class Keywords

ClassComment

Class instances can have text comments displayed in the Access window as described by ClassComment keyword.

ClassGrid

Class instances can be displayed in Grids (Tables) in the Access window as described by ClassGrid keyword.

Associated formatting keywords that can be used within the class definition affecting the display of the grid are ClassGridColumnWidth, ClassGridMaxColumns, ClassGridHideComment and ClassGridHideText.