View Raw SPL
/*****************************************************************************
*                                                                            *
*   XLSHOW.SPL   Copyright (C) 2012 DSP Development Corporation              *
*                               All Rights Reserved                          *
*                                                                            *
*   Author:      Randy Race                                                  *
*                                                                            *
*   Synopsis:    Sets and/or gets Excel visibility mode                      *
*                                                                            *
*   Revisions:   11 Jan 2012  RRR  Creation                                  *
*                                                                            *
*****************************************************************************/


#if @HELP_XLSHOW

    XLSHOW

    Purpose: Sets or gets Excel visibility state

    Syntax:  XLSHOW(vis)
             
                 vis - Optional integer, the visibility states.

                         0: do not display
                         1: display

    Returns: An integer, the current visibilty state.

    Example:
             W1: rand(10, 3);xlput("A1:C10", curr);xlshow(1)

             A 10x3 table of random values is transferred to Excel and
             the Excel Workbook is displayed.

    Remarks:
             XLSHOW returns 1 if Excel is visible, else 0.

    See Also:
             Xlinit
             Xlclear
             Xlget
             Xlput
             Xlsave
             Xlsaveas
#endif


/* set/get Excel visibility */
xlshow(vis)
{
        if (argc > 0) 
        {
                /* set visibilty */
                xlconnect().visible = vis;
        }

        /* return current visibility */
        vis = xlconnect().visible;
        
        return(vis);
}