Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - <b>gfsaveenv()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GFSAVEENV()

    This function saves current environmental settings for restoration
    later with GFRESTENV(). You may optionally save the screen, and
    change the cursor size and/or color setting.

    Syntax

    GFSAVEENV([<savescreen>] , [<cursorsize>] , [<color>])

    Optional Parameters

    <savescreen> may be one of two things:

    - if you wish to save a partial screen, pass an array containing four
    numeric values.  These numeric values will serve as the coordinates
    of the screen to be saved (and subsequently restored by GFRESTENV()).

    - anything else (other than NIL), and the entire screen will be
    saved.

    If you do not pass this, you will be expected to handle screen
    cleanup yourself. Use a comma to skip this parameter.

    <cursorsize> is a numeric representing the new cursor size to use.
    If not passed, the cursor size will be left unchanged. Please refer
    to SETCURS.CH for the appropriate definitions. Use a comma if you
    want to skip this parameter.

    <color> is a character string representing the new color setting to
    use. If not passed, the color will be left unchanged.

    Return Value

    A numeric expression that can be used later with GFRESTENV().

    Notes

    GFSAVEENV() saves current cursor row and column position, cursor
    size, color setting, and (optionally) the contents of the screen.
    These can be later restored with GFRESTENV().  Feel free to modify
    these functions to save and restore more items as you see fit (for
    example, all the hot-keys).

    The following example will not save the screen, turns off the
    cursor, and changes the color to white on blue.

    #include "setcurs.ch"      
    gfsaveenv(, SC_NONE, 'w/b')

    The following example saves the screen, does not change the cursor
    size, and changes the color to red on white.

    gfsaveenv(.t., , 'r/w')

    The following example saves the portion of the screen between row
    10, column 10 and row 14, column 69.  It makes no changes to the
    cursor or color.

    gfsaveenv( { 10, 10, 14, 69 } )

    Sample Usage

    #include "setcurs.ch"                           
                                                    
    setcolor("w/b")                                 
    @ 1, 1 SAY "current position - press any key..."
    inkey(0)                                        
    GFSaveEnv(.t., SC_INSERT, '+w/r') // save screen
    cls                                             
    @ 20, 0 SAY "press any key to switch back"      
    inkey(0)                                        
    GFRestEnv()                                     
    ?? "back at previous position in previous color"

See Also: GFRESTENV() GFSAVESETS()

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