View Raw SPL

#include 

/* sets or gets x axis label */
xlabel(win, argv)
{
        local s;

        if (argc == 0)
        {
                /* return x label of current window */
                return(getxlabel(W0));
        }
        if (argc == 1)
        {
                if (not(iswindow(win)))
                {
                        /* set x label of current window */
                        s = caststring(win);
                        setxlabel(s);
                }
                else
                {
                        /* return x label of win */
                        return(getxlabel(win));
                }
        }
        if (argc >= 2)
        {
                if (not(iswindow(win))) error("xlabel - Window required");
                
                /* set x label of win */
                s = caststring(getargv(1));
                setxlabel(win, s);
        }
}