function isOdd x
  if x mod 2 is 1 then return true else return false
end isOdd

function isEven x
  if x mod 2 is 0 then return true else return false
end isEven

Note that for these functions, 2.5 is neither odd nor even, and non- numbers cause an error. To be safe you would use:

function isOdd x
  if x is a number and x mod 2 is 1 then return true else return false
end isOdd

function isEven x
  if x is a number and x mod 2 is 0 then return true else return false
end isEven


On Feb 8, 2006, at 6:28 AM, Robert Presender wrote:

How does one determine if a number is odd or even?

For example I would like to do something like this:

If the lineNumber of line x of fld "List" is odd then set the textColor to red.

Suggestions are appreciated.

Regards ... Bob

_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to