home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / xplodasc.prg < prev    next >
Text File  |  1993-10-14  |  1KB  |  61 lines

  1. /*
  2.  * GT CLIPPER STANDARD HEADER
  3.  *
  4.  * File......: xplodasc.prg
  5.  * Author....: Andy M Leighton
  6.  * BBS.......: The Dark Knight Returns
  7.  * Net/Node..: 050/069
  8.  * User Name.: Andy Leighton
  9.  * Date......: $Date$
  10.  * Revision..: $Revision$
  11.  *
  12.  * This is an original work by Andy Leighton and is placed in the
  13.  * public domain.
  14.  *
  15.  * Modification history:
  16.  * ---------------------
  17.  *
  18.  * $Log$
  19.  *
  20.  */
  21.  
  22. /*  $DOC$
  23.  *  $FUNCNAME$
  24.  *       GT_EXPLODEASCII()
  25.  *  $CATEGORY$
  26.  *       String
  27.  *  $ONELINER$
  28.  *       Explode a string into an array of ascii values
  29.  *  $SYNTAX$
  30.  *       GT_ExplodeAscii(<cStr>) --> aAscVals
  31.  *  $ARGUMENTS$
  32.  *       <cStr>     -  The string to explode
  33.  *  $RETURNS$
  34.  *       aAscVals   -  An array of ascii values
  35.  *  $DESCRIPTION$
  36.  *       Explode a string into an array of ascii values
  37.  *  $EXAMPLES$
  38.  *       aVals := GT_ExplodeAscii("Hello World")
  39.  *
  40.  *       for i := 1 to len(aVals)
  41.  *          ? aVals[i], "   ", chr(aVals[i])
  42.  *       next
  43.  *
  44.  *  $SEEALSO$
  45.  *       GT_IMPLODEASCII()
  46.  *  $END$
  47.  */
  48.  
  49. #include "gt_LIB.ch"
  50.  
  51. function GT_ExplodeAscii(cStr)
  52.  
  53.    local aAscVals := array(len(cStr))
  54.    local i
  55.  
  56.    for i := 1 to len(cStr)
  57.       aAscVals := asc(substr(cStr, i, 1))
  58.    next
  59.  
  60. return aAscVals
  61.