CTOI - character string to integer.

Usage:

type
    string = packed array[0..MAXSTR] of char;
var
    i : integer;
    n : integer;
    s : string;
function
    ctoi(var s:string; var i:integer):integer;
        extern;
...
i := 0;
n := ctoi(s, i);

Description:

CTOI converts a sequence of ASCII digits into the corresponding integer and returns the integer. CTOI begins scanning the string "s" at the position given by the parameter "i". The position of the character that stopped the scan is returned in the variable parameter "i". The number may have a leading sign, and leading blanks or tabs are ignored. For the routine to work correctly, the array type used to define "string" MUST have origin 0. Note that all parameters are "var" parameters.

Copyright © 1996, Thinkage Ltd.