Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FlexFile Reference Guide - <b>a_store()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 A_STORE()
 Store an expression into an element of an array
-------------------------------------------------------------------------------

 Syntax

    A_STORE( <aTarget>,
             <expValue>,
             <idxPos> )    ->    lSuccess

 Arguments

    <aTarget> is the array in which to store <expValue>.

    <expValue> is any simple Clipper expression that evaluates to the
    same type as the array.

    <idxPos> is the index to the element whose value will become
    <expValue>.

 Returns

    A_STORE() returns (.T.) if successful, otherwise, (.F.).

 Description

    A_STORE() stores a value in a FlexFile type array.  The value
    being stored must be of the same type as that of the array.
    Storing a value with a different type than the array is considered
    an error and A_STORE() will return (.f.).

    +-------------------------- WARNING ---------------------------+ 
    | You must use A_KILL() to release the data that has been type | 
    | A_STORE()d to a string type array before allowing the array  | 
    | to fall out of scope.                                        | 
    +--------------------------------------------------------------+ 

 Examples

    // Declare a two dimensional (C)haracter array
    LOCAL rows, cols, x, y, z

    rows = 10
    cols = 20
    z = 1
    aChar = A_DECLARE( "C", rows, cols )

    // Fill the array with increasing character values.
    FOR x = 1 to rows
       FOR y = 1 to cols
          z++
          A_STORE( aChar, chr(z), A_( x, y ) )
       NEXT
    NEXT

    // Print out the results: All ASCII characters from one
    // to 200.  If you run this program it will beep an sqauk
    // and generally look ugly.
    FOR x = 1 to rows
       FOR y = 1 to cols
          z++
          ? A_RETRIEVE( aChar, A_( x, y ) )
       NEXT
    NEXT


See Also: A_KILL() A_FILL() A_RETRIEVE()

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