• Introduction:
    PowerD has very flexible syntax what means, that You can use several of these to enshort or simplify Your code. Most of these examples are also shown in given documents, but this part shows most of these together.

  • SELECT <constant>:
    If You want to eg.: check a variable for several strings, You can use eg.: IF statement:
      IF StrCmp(name,'one')
        x:=1
      ELSEIF StrCmp(name,'two')
        x:=2
      ELSEIF StrCmp(name,'three')
        x:=3
      ELSEIF StrCmp(name,'four')
        x:=4
      ELSE
        x:=0
      ENDIF
    

    But SELECT statement supports also a constant for it's comparing variable:
      SELECT TRUE
      CASE StrCmp(name,'one');   x:=1
      CASE StrCmp(name,'two');   x:=2
      CASE StrCmp(name,'three'); x:=3
      CASE StrCmp(name,'four');  x:=4
      DEFAULT;                   x:=0
      ENDSELECT
    

  • Conditions:
    PowerD's conditions each time returns TRUE if the condition is true and FALSE if not.
      a:=IF <condition> THEN TRUE ELSE FALSE
    

    is the same as the:
      a:=<condition>
    

  • Multiple conditions:
    PowerD condition scanner supports multiple conditions like:
      IF a>b>c THEN PrintF('True\n')
    

    This is internaly converted to:
      IF a>b AND b>c THEN PrintF('True\n')
    

  • PreProcessor assign shortage:
    PowerD preprocessor has a feature, that checks each <var>:=.<item>. Each:
      var:=.item
    

    will be replaced with:
      var:=var.item
    

    But pay attention, this is only the preprocessor feature and it doesn't check for anything.