opendap/src/main/java/opendap/servlet/ascii/asciiGrid.java
public void toASCII(PrintWriter pw,
                        boolean addName,
                        String rootName,
                        boolean newLine) {

        if (_Debug)
            System.out.println("asciiGrid.toASCII(" + addName + ",'" + rootName + "')  getName(): " + getEncodedName());

        if (rootName != null)
            rootName += "." + getEncodedName();
        else
            rootName = getEncodedName();

        boolean firstPass = true;
        Enumeration e = getVariables();
        while (e.hasMoreElements()) {
            toASCII ta = (toASCII) e.nextElement();

            if (!newLine && !firstPass)
                pw.print(", ");

            ta.toASCII(pw, addName, rootName, newLine);

            firstPass = false;
        }

        if (newLine)
            pw.print("\n");

    }
public void toASCII(PrintWriter pw,
                        boolean addName,
                        String rootName,
                        boolean newLine) {

        if (_Debug)
            System.out.println("asciiGrid.toASCII(" + addName + ",'" + rootName + "')  getName(): " + getEncodedName());

        if (rootName != null)
            rootName += "." + getEncodedName();
        else
            rootName = getEncodedName();

        boolean firstPass = true;
        Enumeration e = getVariables();
        while (e.hasMoreElements()) {
            toASCII ta = (toASCII) e.nextElement();

            if (!newLine && !firstPass)
                pw.print(", ");

            ta.toASCII(pw, addName, rootName, newLine);

            firstPass = false;
        }

        if (newLine)
            pw.print("\n");

    }
Returns a string representation of the variables value. This
is really foreshadowing functionality for Server types, but
as it may come in useful for clients it is added here. Simple
types (example: DFloat32) will return a single value. DConstuctor
and DVector types will be flattened. DStrings and DURL's will
have double quotes around them.

@param addName is a flag indicating if the variable name should
appear at the begining of the returned string.