11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

$ASCII$ASCIIReturns the character code value for an expression.$ASCII(expression,position)$A(expression,position)ParametersexpressionpositionThe character to be converted.Optional — The position of a character within a character string.Description$ASCII returns the character code value for a single character specified in expression. Thischaracter can be an 8-bit (ASCII) character or a 16-bit (Unicode) character.The expression may evaluate to a single character or to a string of characters. If expressionevaluates to a character string, you include the optional position parameter to indicate whichcharacter you want to convert.ParametersexpressionThe expression can be specified as the name of a variable, a numeric value, a string literal,or any valid <strong>Caché</strong> <strong>ObjectScript</strong> expression. If expression yields more than one character,use position to select the desired character. If you omit position for a character string, $ASCIIreturns the numeric code for the first character. $ASCII returns -1 if the expression evaluatesto a null string.positionThe position must be specified as a non-zero positive integer. It may be signed or unsigned.You can use a non-integer numeric value in position; however, <strong>Caché</strong> ignores the decimalportion and only considers the integer portion of the numeric value. If you do not includeposition, $ASCII returns the numeric value of the first character in expression. $ASCIIreturns -1 if the integer value of position is larger than the number of characters in expressionor less than 1.ExamplesThe following example returns 87, the ASCII decimal value of the character W.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 179

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!