1.9 xestiascan_variablecheck

xestiascan_variablecheck checks variables that are passed to it to see if the content of that variable is valid and returns an error if it isn’t. All the parameters are needed each time the subroutine is called and if the noerror parameters is set to 1 then a value is returned when an error occurs. Otherwise, a standard error will be given.

Parameters:

xestiascan_variablecheck(variable, type, option, noerror);


Usage:

xestiascan_variablecheck(“Test 123”, “lettersnumbers”, “”, 0);
$letters_letnum_check = xestiascan_variablecheck(“Test 123”, “lettersnumbers”, “”, 1);


Value Description
numbers Check if the variable given only contains characters.
decimal Check if the variable given is a valid decimal number.
lettersnumbers Check if the variable given only contains letters and numbers.
maxlength Check if the variable given does not exceed the specific length given.
blank Check if the variable given is blank.
filename Check if the variable given is a valid filename.
filenameindir Check if the variable given is a valid filename in a directory.
datetime Check if the variable given is a valid date and time format.
directory Check if the variable given is a valid directory name.
language_filename Check if the variable given is a valid language filename.
module Check if the variable given is a valid module name.
utf8 Check if the variable given is a correctly formatted UTF8 string.
serverprotocol Checks to see if the variable given contains a valid server protocol (TCP or UDP).
port Check to see if the port number given is a valid port number (0-65535)


option
Specifies the setting to be used with the test.

noerror
Specifies if no error message should be returned but a value should be returned instead so that a more specific error message can be used.

For more information on what values are returned, please look at the xestiascan_error subroutine in the Kiriwrite source code.