1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Multiple OR operators in a single IF

Discussão em 'StackOverflow' iniciado por fdantas, Setembro 11, 2018.

  1. fdantas

    fdantas Administrator Moderador

    How to have multiple OR operators in a single if statement? I tried this way but there's an error of:


    Incompatible data types in expression or assignment.

    I looked at documentation of length function and it is LENGTH ( {string | raw-expression | blob-field } [ , type ] )?

    Here's the code:

    DEFINE VARIABLE cMonth AS CHARACTER.
    DEFINE VARIABLE cDay AS CHARACTER.
    DEFINE VARIABLE cYear AS CHARACTER.

    UPDATE cDateFromUser.

    cDay = (SUBSTRING(cDateFromUser,1,2)).
    cMonth = (SUBSTRING(cDateFromUser,3,2)).
    cYear = (SUBSTRING(cDateFromUser,5,4)).

    IF (LENGTH(iDay <> 2)) OR (LENGTH(iMonth <> 2)) OR (LENGTH(iYear <> 4)) THEN DO:
    /*Code*/
    END.
    ELSE DO:
    /*Code*/
    END.

    Continue reading...

Compartilhe esta Página