Category : Pascal Source Code
Archive   : POSFUN.ZIP
Filename : POSNUM.MAN
Function: Find the position and length of a numeric substring
embedded within a target string.
Declaration: (Turbo Pascal, version 5)
function posnum(var s:string;var l:integer):integer;
Description:
"PosNum" returns the position of the first valid numeric
substring within the target string "s". The length of the numeric
substring is returned in the parameter "l". If no valid numeric
substring is found, "PosNum" returns 0.
A "valid numeric substring" consists of at least one decimal
digit, optionally preceded by a plus or minus sign, containing no
more than one decimal point, optionally followed by an exponent
('e' or 'E' preceding a signed or unsigned integer). This will
find signed and unsigned integers, floating point numbers and
numbers in scientific notation. Expressions like "-.E" will NOT
be identified as a valid number.
Example: See NFIND.PAS.
Bugs:
"PosNum" finds the first occurrence of anything that can
possibly be interpreted as a valid number and returns the length
of the largest substring that can be interpreted as a valid
number. No test is made to determine whether the number can be
represented in machine floating point format. Integers that are
separated by periods or hyphens may not give you the results that
you expect.
A comma is not considered to be a part of a valid number.
A dollar sign is not considered to be a part of a valid
number.
Author: J. W. Rider, Email: CIS [72426,1640].
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/