Inspection


These functions all start with is (for example, isalpha(), isdigit) and return a true (1) or false (0) value depending on the composition of the string. Each of these functions is based on the C language function of the same name, but is applied to the whole string: isdigit(string) will return true if every character in the string is a digit, and false otherwise.

Note: For all functions except isdigit() and isxdigit(), the set of characters understood to be alphabetic is inherited from the setlocale() setting used on the machine running Miva. For this reason, these functions are not guaranteed to return the same results on all machines.

Name -- Syntax / Description
fisdir
fisdir( path )
Tests if the file named in path is a directory.
Returns 1 if the path is a directory else 0.
  • path = the fully qualified path to the directory
isalnum
isalnum( string )
Test if all characters are either alphabetic or digits
Returns 1 if true, 0 if false
  • string = the characters tested
isalpha
isalpha( string )
Test if all characters are alphabetic.
Returns 1 if true, 0 if false
  • string = the characters tested
isascii
isascii( string )
Test if all characters are ASCII characters (those with decimal value between 0 and 127).
Returns 1 if true, 0 if false
  • string = the characters tested
iscntrl
iscntrl( string )
Test if all characters are control characters (those with decimal value between 0 and 31, or 127).
Returns 1 if true, 0 if false
  • string = the characters tested
isdigit
isdigit( string )
Test if all characters are digits in the range 0-9.
Returns 1 if true, 0 if false
  • string = the characters tested
isgraph
isgraph( string )
Test if all characters are graphic (see isprint) characters (those with decimal value between 33 and 127).
Returns 1 if true, 0 if false
  • string = the characters tested
islower
islower( string )
Test if all characters are lowercase letters,
Returns 1 if true, 0 if false
  • string = the characters tested
isprint
isprint( string )
Test if all characters are printable (same as graphic characters, with the addition of the space character).
Returns 1 if true, 0 if false
  • string = the characters tested
ispunct
ispunct( string )
Test if all characters are whitespace (space, tab, vertical tab, newline, form feed) characters.
Returns 1 if true, 0 if false
  • string = the characters tested
isspace
isspace( string )
Test if all characters are whitespace (space, tab, vertical tab, newline, form feed) characters.
Returns 1 if true, 0 if false
  • string = the characters tested
isupper
isupper( string )
Test if all characters are uppercase letters.
Returns 1 if true, 0 if false
  • string = the characters tested
isxdigit
isxdigit( string )
Test if all characters are hexadecimal digits (a-f, A-F, 0-9).
Returns 1 if true, 0 if false
  • string = the characters tested
sisdir
sisdir( path )
Tests if the file named in path is a directory.
Returns 1 if the path is a directory else 0.
  • path = the fully qualified path to the directory
User Annotations: inspection
James R. M. Waters : jwaters at, mivamerchant d0t com
07/22/2011 12:56 a.m.
Also, fexists( path ) and sexists( path ) exist, and return whether a file exists.<br>
[admin] See the File System functions.
<MvIF EXPR = "{ fexists( 'path/relative/to/mivadata/file.txt' ) }">
  <strong>File exists!</strong>
</MvIF>