Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>array storage in fpt/smt memo fields:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Array storage in FPT/SMT memo fields:

  You can store and retrieve arrays (even multi-dimensional arrays) to an
  FPT/SMT memo field, just as you would store and retrieve a string.

  For example, assuming that PHONES is a memo field in our CUSTOMER.DBF
  file, we could do this:

   +----------------------------------------------------------------------+
   |  LOCAL aPhones := {}, aTesting := {}, nCount                         |
   |                                                                      |
   |  // Add four elements to the aPhones array                           |
   |  aadd( aPhones, "714-252-4263" )                                     |
   |  aadd( aPhones, "213-555-1212" )                                     |
   |  aadd( aPhones, "310-666-5333" )                                     |
   |  aadd( aPhones, "214-567-0987" )                                     |
   |                                                                      |
   |  use CUSTOMER via "SIXNSX"     // Open our database                  |
   |  dbAppend()                    // Add a new record                   |
   |  customer->PHONES := aPhones   // Store the array in the memo field  |
   |  ? ValType( customer->PHONES ) // Returns: "A"                       |
   |                                                                      |
   |  // Just to make sure it stored okay...                              |
   |  aTesting := customer->PHONES  // Store memo field value to a memvar |
   |                                                                      |
   |  // Display contents of the memvar (array)                           |
   |  for nCount := 1 to len( aTesting )                                  |
   |    ? aTesting[ nCount ]                                              |
   |  next                                                                |
   |                                                                      |
   +----------------------------------------------------------------------+

  That's it!

  NOTE:  The only caveats to be aware of are that array elements that
         contain code blocks will be converted to NIL.  This is not a bug.
         It's just a law of physics.  Code blocks can't be stored and
         retrieved to/from a file.  Also, if you attempt to store a recur-
         sive array in a memo field (i.e., one of the array elements is a
         reference to the same array), your PC will take off for Never-Never
         Land.


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