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>function to convert a string of data to an array.</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Function to convert a string of data to an array.
------------------------------------------------------------------------------

 Syntax

        GT_Str2a(<cString>,<bConvert>],<nLength>) -> aReturn

 Arguments:

      <cString> is a Character string containing fixed
      length sub-strings. These sub-strings will be
      extracted to be used to form the array.

      <bConvert> is the code block which will be passed
      the extracted substring and return the converted
      data.

      <nLength> is the length of each sub-string.

 Returns:

      GT_Str2a() returns the new array.

 Description:

      Function to convert a string of data to an array.
      This is generally used to extract data that has
      been put into a string for the purposes of storage
      to a .mem file. The data can be put into the string
      using GT_a2Str().

 Examples:

      // To convert a string of numbers to an array of
      // numbers
      cNumbers := '112834456378990'

      aNumbers := GT_Str2a( ;
                      cNumbers, ;
                      { | cData | Val(cData) }, ;
                      3)

      // Giving {112,834,456,378,990}

 Source: GT_STR2A.PRG

 Author:  Martin Bryant

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