home *** CD-ROM | disk | FTP | other *** search
- // ASC.SCP - Function to convert a character into an integer
- // Copyright (c) 2000, Vector Networks Limited
- // All Rights Reserved
- //
- // Revision History:
- // 5.3 31-Jul-00 DB - Created.
-
- // There is no Scripting function to return the integer value of a
- // character. This makes (signed) comparisons impossible, and
- // hence strings cannot be sorted. The Asc () function makes up
- // for this by performing the conversion the hard way...
-
- Function Asc (Character as String) as Integer
- Dim Result as Integer
-
- Result = 0
-
- If IsString (Character) then
- For x = 0 to 255
- If Chr (x) = Character then
- Result = x
- Exit For
- Endif
- Next
- Endif
-
- Asc = Result
- End Function
-