Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>return the ascii value of a specified character in a string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Return the ascii value of a specified character in a string
------------------------------------------------------------------------------

 Syntax

        GT_Ascpos(<cStr>, <nPos>) --> nAscVal

 Arguments:

      <cStr>  - The string
      <nPos>  - The position in <cStr>

 Returns:

      nAscVal - The ascii value of substr(<cStr>, <nPos>, 1)

 Description:

      Return the ascii value of a specified character in a string
      Equivalent (but much faster) to
          asc(substr(cStr, nPos, 1)

      NOTE:
         invalid parameters will return -1
         nPos > len(cStr)   will return -2

      This last behaviour is different to the Funcky function of the
      same name.  I changed the behaviour because some of the strings
      I process contain embedded NULs.

 Examples:

       ? gt_ascpos("the cat sat on the mat", 3)
                                   // prints e

 Source: ASCPOS.C

 Author:  Andy M Leighton

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson