2 Replies Latest reply on Nov 23, 2014 9:09 AM by FredH

    Check if value is integer



      Check if value is integer


      Hi Experts,

      I have a script that asks the user for a value using a dialog box.  
      I would like to be sure that the user only adds an positif and integer value.

      Any idea how this could be done?

      Thanks in advance!




        • 1. Re: Check if value is integer

          If [ Int ( YourTable::YourField ) = YourTable::YourFIeld and YourTable::YourFIeld > 0 ]

          You could also define this auto-enter calculation that makes it impossible to enter a negative or noninteger value:

          Filter [ Self ; 9876543210 ]

          Also clear the "do not replace existing value.." check box and if the user enters a value that is not a positive integer, it will auto-correct to become one that is. (This may be dangerous for many data entry scenarios.)

          • 2. Re: Check if value is integer

            Thanks PhilModJunk, 

            I applied the "if" as it I already had part of an If statement linked to my dialog box in my script!
            It worked perfectly

            Kind regards,