scripting@wanadoo.nl




IsLower()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
28 March 2002 IsLower()
AuthorHumberto Roche-García(Puerto Rico)
Action This function determines supplied string is lowercase.
SyntaxIsLower ($ExpC, OPTIONAL $ExpTrig) 
Parameters
  • $ExpC (Required / String) Character string to evaluate.
  • $ExpTrig (Required / String) Trigger to determine function evaluation for supplied string. Whether: No Trigger passed then to determine whether the leftmost character in a string is Lowercase. Trigger passed as 0 then to evaluate all characters of supplied string for Lowercase. 
  • RemarksNOTE: This function now combines IsALower() and IsLower() in one ISLOWER function. Also changed return value for ISLOWER to be as 1 in order to comply with standards on other programming languages.
    No negative numbers on $ExpTrig.
    Does not skip Special Chars and numbers.
    Does not skip Empty strings. 
    ReturnsReturns 1 if evaluated character(s) is/are in Lowercase. Returns 0 if evaluated character(s) is/are not Lowercase. 
    DependenciesNone. 
    Examples
    ? "-----ISLOWER"
    $THIS = ISLOWER("")
    ? "THIS=0 compare to $THIS"
    $THIS = ISLOWER(0)
    ? "THIS=0 compare to $THIS"
    $THIS = ISLOWER("Hola")
    ? "THIS=0 compare to $THIS"
    $THIS = ISLOWER("hola")
    ? "THIS=1 compare to $THIS"
    $THIS = ISLOWER("1ola")
    ? "THIS=0 compare to $THIS"
    $THIS = ISLOWER("hola", 7)
    ? "THIS=0 compare to $THIS"
    $THIS = ISLOWER("hola",2)
    ? "THIS=1 compare to $THIS"
    $THIS = ISLOWER("hola Bob",5)
    ? "THIS=0 compare to $THIS"
    $THIS = ISLOWER("holA",4)
    ? "THIS=0 compare to $THIS"
    $THIS = ISLOWER("hola", 0)
    ? "THIS=1 compare to $THIS"
    
     
    Source
    FUNCTION IsLower ($expc, OPTIONAL $exptrig)
      ; Not $ExpTrig passed then to determine whether the leftmost character in a string is Lower Case
      ; With $ExpTrig = 0 then to evaluate all characters of supplied string for Lower Case
      ; With $ExpTrig > 0 evaluate the Nth character of supplied string for Lower Case
      ; No negative numbers on $ExpTrig
      ; Does not skip Special Chars and numbers
      ; Does not skip Empty strings
      ; Returns 1 if evaluated character(s) is/are in Lower Case
      ; Returns 0 if evaluated character(s) is/are not Lower Case
    
      $islower = 0
      IF Len($expc) >= 1
        IF $exptrig <> ""
          IF $exptrig > 0 ; Evaluate Nth character if supplied string
            IF $exptrig <= Len($expc)
              IF Asc(Substr($expc, $exptrig, 1)) >= 97 AND Asc(Substr($expc, $exptrig, 1)) <= 122
                $islower = 1
              ENDIF
            ENDIF
          ELSE
            IF $exptrig = 0 ; Not for Negative numbers - Evaluate all characters of supplied string
              $locallen = Len($expc)
              $islower = 1
              FOR $localstart = 1 TO $locallen
                $localstring = Substr($expc, $localstart, 1)
                IF Asc($localstring) < 97 AND Asc($localstring) > 122
                  $islower = 0
                ENDIF
              NEXT
            ENDIF
          ENDIF
        ELSE
          ; Just evaluate first character of supplied string
          $localstring = Left($expc, 1)
          IF Asc($localstring) >= 97 AND Asc($localstring) <= 122
            $islower = 1
          ENDIF
        ENDIF
      ENDIF
    ENDFUNCTION ; - IsLower -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter