Sfairadora

  • Reference Guide

skip_number

skip_number(str, n)
skip_number(str, n, var_num)
Returns the index of the first character in the string str after the position n (including the character at the index n) that is not a valid character of a real number representation. In other words, the function skips the number at the position n. If there is no number at the position n, the index n is returned. The index of the first character in the string is 0. If n is negative, the value 0 is used. If the parameter var_num is specified, it is a variable where to store the skipped number.
The parameter str can be String, Text or Rich_string. The parameter n and the return value are of the type Int. The parameter var_num is an l-value of the type Real.
The functions whose name begins with skip_… serve to analyze a string. The best way to use them is to create a variable containing an index (pointer) of the current position within the string. This variable is passed to the appropriate skip­_… function as the parameter determining the place, where to search the string from. The resulting value (the new pointer) is then assigned back to the variable.
Example:
var Real nmuber;
pos = skip_number(str, pos, number);

See Also