Search results

  1. C

    Check if char string is integer

    I've add LEFT-TRIM FUNCTION isInteger RETURNS LOGICAL( cInteger AS CHARACTER) : DEF VAR lTest AS LOGICAL NO-UNDO. ASSIGN lTest = (cInteger NE ?) AND (STRING(INTEGER(cInteger)) EQ LEFT-TRIM(TRIM(cInteger), "0":U)) NO-ERROR. RETURN lTest. END FUNCTION. because of MESSAGE...
  2. C

    Check if char string is integer

    MESSAGE isinteger(' 90') VIEW-AS ALERT-BOX INFO BUTTONS OK. It depend if leading space sholud be interpreted as correct integer or not. MESSAGE isinteger(?) VIEW-AS ALERT-BOX INFO BUTTONS OK. Yes , you right, unknown value shold be treated.
  3. C

    Check if char string is integer

    FUNCTION isInteger RETURNS LOGICAL( cInteger AS CHARACTER) : DEFINE VARIABLE iInteger AS INTEGER NO-UNDO. iInteger = INTEGER(cInteger) NO-ERROR. IF ERROR-STATUS:ERROR THEN RETURN FALSE. IF STRING(iInteger) NE cInteger THEN RETURN FALSE. RETURN TRUE. END FUNCTION.
Top