ASCPOS()

ASCII value of a character at a certain position

Syntax

ASCPOS (<cString>, [<nPosition>]) --> nAsciiValue

Arguments

<cString> is the processed string [<nPosition>] is an optional position within <cString> Default: last position in <cString>

Returns

<nAsciiValue> the ASCII value of the character at the specified position

Description

The ASCPOS() function returns the ASCII value of the character that can be found at the position <nPosition> in <cString>. If <nPosition> is larger than the length of <cString>, 0 is returned.
Examples
      ? ascpos ("0123456789") --> 57
      ? ascpos ("0123456789",1) --> 48
Tests
      ascpos ("0123456789") == 57
      ascpos ("0123456789",1) == 48
      ascpos ("0123456789",11) == 0  //  to large !
Status

Ready

Compliance

ASCPOS() is compatible with CT3's ASCPOS().

Platforms

All

Files

Source is asciisum.c, library is libct.

See Also