View Raw SPL
/*****************************************************************************
*                                                                            *
*   ISWINDS.SPL  Copyright (C) 2008 DSP Development Corporation              *
*                               All Rights Reserved                          *
*                                                                            *
*   Author:      Randy Race                                                  *
*                                                                            *
*   Synopsis:    Checks if a window contains a directly loaded saved series  *
*                                                                            *
*   Revisions:   14 Mar 2008  RRR  Creation                                  *
*                                                                            *
*****************************************************************************/

#include 

#if @HELP_ISWINDS

    ISWINDS

    Purpose: Checks if a Window contains a saved series.

    Syntax:  ISWINDS(w)

                w - Optional Window. Defaults to the current Window.

    Returns:
             An integer, 1 if successful else 0.

    Example:
             W1: gnorm(1000, 1)
             W2: RUN1.1.ANALOG1
             W3: integ(RUN1.1.ANALOG1)

             a = iswinds(w1);
             b = iswinds(w2);
             c = iswinds(w3);

             Both a and c are 0 indicating the Window contains a derived
             series, i.e. a newly generated series or a series derived from
             an existing series. b == 1, indicating that W2 contain a series
             saved in a dataset.

    Remarks:
             ISWINDS checks if a Window exclusively contains a series saved
             in an existing dataset. The Window formula is parsed to check
             if the formula is in dataset.ver.series format.

             See ISDSSERIES to check if a string is in dataset.ver.series
             format.

   See Also:
             ISDSSERIES
             STRGET
#endif


/* does window exclusively contain a saves series? */
iswinds(w)
{
        local status = 0;

        if (argc < 1)
        {
                /* default to current window */
                w = refwin(W0);
        }

        if (iswindow(w))
        {
                /* see if formula is a dataset.ver.series */
                status = isdsseries(w);
        }
        
        return(status);
}