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_scroll()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 A_SCROLL()
 Scroll all or part of an array
-------------------------------------------------------------------------------

 Syntax

    A_SCROLL(    <aTarget>,
                 [<idxPos>],
                 [<nCount>],
                 [<nMagnitude>] )

 Arguments

    <aTarget> is the array in which elements will be scrolled.

    <idxPos> is the first position to in the <aTarget> array to be
    scrolled.  If not specified, the default value is the first
    element.

    <nCount> is the number of elements to be scrolled starting at
    <idxPos>. If not specified, elements are scrolled to the end of
    the array.

    <nMagnitude> indicates how far and in what direction to scroll the
    array. A positive value scrolls the elements up (toward the
    beginning); a negative value scrolls the elements down (towards
    the end).  If no value is specified, the defined range is scrolled
    one element up.

 Returns

    None.

 Description

    A_SCROLL() scrolls all or a portion of a FlexFile array
    <nMagnitude> number of elements.  All elements at the end of the
    scroll are lost and the new elements are initialized to null.  Do
    not confuse FlexFile's null with Clipper's NIL.  A numeric null is
    0, a logical null is (.F.) and a string null is "".

    Wrapping will occur if <nCount> goes beyond the current row
    pointed to by <idxPos>.  For example, if you have a two
    dimensional array with accounts represented by the first dimension
    and 12 prior period amounts in the second dimension, and you
    wanted to scroll the first quarter (i.e. 3 periods) up in the
    array, making <nCount> three times the number of accounts will
    "wrap" the scroll.  Three periods worth of amounts will be
    scrolled out of the array and three periods of 0's will be filled.
    See the discussion on arrays in chapter 2 for more information on
    this feature.

 Examples

    LOCAL ffArray, accounts, periods

    accounts = 50
    periods = 12

    // Declare a FlexFile double precision type array.
    ffArray = A_DECLARE( 'D', periods, accounts )

    // Close out a quarter by scrolling three periods.
    // (i.e. scroll all accounts by 3 periods.)
    A_SCROLL( ffArray, , , -(accounts * 3) )

    // Insert a new account just in front of the 7th account.
    accounts++
    A_SIZE( ffArray, periods, accounts )
    FOR x = 1 to periods
       A_SCROLL( ffArray, A_( x, 7 ), accounts - 7, -1 )
    NEXT


See Also: A_INS() A_DEL() A_SCAN()

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