Bool Expression in Modar

  • Bool expression is only valid in if and while statement in Modar script language, here is the full lists operators available

  • Comparing operators

    ==

    Equal to

    !=

    Not equal to

    >=

    Greater than or equal to

    <=

    Less than or equal to

    > 

    Greater than

    Less than

    .head.

    Whether sting1 (left) begin with string2(left)  (case insensitive)

    .isOneof.

    Whether string1 is one of string2, which is a list (case insensitive)

       Example: if($day .isoneof. “Monday Tuesday Sunday”) ...


     Please note that Math expression can be used in both sides of operators excepts “.head.” and “.isOneof.”, which are only for string comparison.


  • Test operators

    -f <filename>

    Whether file exists or not

    -d <folder name>

    Whether directory exists or not

    -var <variable name>

    Whether variable declared or not

    -z <string>

    Whether the string is empty

    -os <os type>

    To test which OS runs on, available are MSW, Linux, MacOSX,

    This is used to test first before call a external system utilityes

    For example to remove a batch of files by calling system utilities

    If(-os msw) exec del *.out

    Else  exec rm –rf *.out


  • Self operators

    !

    Not



 


  Contact us

  Phone: 400-660-8656
  Email: support@beemd.org

 

       我们长期和北京市计算中心合作提供计算培训服务,承接托管计算业务,如有需求请随时联系我们。