swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
operator  

<= (less than or equal to)

 
 

Return type: Switch
Returns:       True if the first expression is equal to or less than the second, and false otherwise.

Syntax

expression1 <= expression2


Purpose

Use the <= operator to determine whether one expression is equal to or less than another. You can use it with any data type expression.

To compare BCD numbers, you must import the ombcd.xmd file in your program. To compare floating point numbers, import the omfloat.xmd file.

You can compare values of mixed data types (for example, BCD numbers and integers) as long as you follow the rules listed in Operations with mixed data types.

For example:

  ; Comparing strings for <=
  process
     local stream string-1 initial {"Catch-up"}
     local stream string-2 initial {"Catch-22"}
     do when string-2 > string-1
        output string-2
            || " > "
            || string-1
            || "%n"
     else when string-2 <= string-1
        output string-2
            || " <= "
            || string-1
            || "%n"
  
     done
  ; Output: "Catch-22 <= Catch-up"

Mixed data type example:

  import "ombcd.xmd" unprefixed
  process
     local integer one-integer initial {33}
     local bcd one-bcd initial {33}
     do when (one-bcd <= one-integer)
        output "Correct. BCD of "
            || "d" % one-bcd
            || " shown as less than or equal to integer of "
            || "d" % one-integer
            || ".%n"
     else
        output "Error. BCD of "
            || "d" % one-bcd
            || " shown as not less than or equal to integer of "
            || "d" % one-integer
            || ".%n"
     done
  ; Output: "Correct. BCD of 33 shown as less than or equal to integer of 33."

This operator has two deprecated synonyms: is less-equal and isnt greater-than.

    Related Syntax
 
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:51:21 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.