scripting@wanadoo.nl




IsUpper()

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 IsUpper()
AuthorHumberto Roche-García(Puerto Rico)
Action This function determines supplied string is uppercase.
SyntaxIsUpper ($ExpC, OPTIONAL $ExpTrig) 
Parameters
  • $ExpC (Required / String) Character string to evaluate.
  • $ExpTrig (Required / String) Trigger to determine function evaluation for supplied string (No Trigger passed then to determine whether the leftmost character in a string is Uppercase. Trigger passed as 0 then to evaluate all characters of supplied string for Uppercase). 
  • RemarksNOTE: This function now combines IsAUpper() and IsUpper() in one ISUPPER function.
    Also changed return value for ISUPPER 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 Uppercase.
    Returns 0 if evaluated character(s) is/are not Uppercase. 
    DependenciesNone. 
    Examples
    Examples ? "-----ISUPPER"
    $THIS = ISUPPER("")
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER(0)
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER("Hola")
    ? "THIS=1 compare to $THIS"
    $THIS = ISUPPER("hola")
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER("1OLA")
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER("HOLA", 7)
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER("hola",2)
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER("hola Bob",5)
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER("hola Bob",6)
    ? "THIS=1 compare to $THIS"
    $THIS = ISUPPER("holA",4)
    ? "THIS=1 compare to $THIS"
    $THIS = ISUPPER("hola", 0)
    ? "THIS=0 compare to $THIS"
    $THIS = ISUPPER("HOLA", 0)
    ? "THIS=1 compare to $THIS"
    $THIS = ISUPPER("HOLA", -1)
    ? "THIS=0 compare to $THIS"
    
     
    Source
    FUNCTION IsUpper ($expc, OPTIONAL $exptrig)
      ; Not $ExpTrig passed then to determine whether the leftmost character in a string is Upper Case
      ; With $ExpTrig = 0 then to evaluate all characters of supplied string for Upper Case
      ; With $ExpTrig > 0 evaluate the Nth character of supplied string for Upper 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 Upper Case
      ; Returns 0 if evaluated character(s) is/are not Upper Case
      $isupper = 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)) >= 65 AND Asc(Substr($expc, $exptrig, 1)) <= 90
                $isupper = 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) < 65 AND Asc($localstring) > 90
                  $isupper = 0
                ENDIF
              NEXT
            ENDIF
          ENDIF
        ELSE
          ; Just evaluate first character of supplied string
          $localstring = Left($expc, 1)
          IF Asc($localstring) >= 65 AND Asc($localstring) <= 90
            $isupper = 1
          ENDIF
        ENDIF
      ENDIF
    ENDFUNCTION ; - IsUpper -
     
      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