Skip to main content
Inspiring
November 20, 2010
Question

variable from a writeoutput?

  • November 20, 2010
  • 1 reply
  • 857 views

If I have this cfscript:

<cfscript>

    myxmldoc = XmlParse("D:\pathtoxmlfile\editorial\#whichsection#\#Uploaded_Folder_Name#\#htmlFileName#");

    selectedElements = XmlSearch(GetTheTitle, "/html/body/h1");

    for (i = 1; i LTE ArrayLen(selectedElements); i = i + 1)

        writeoutput(selectedElements.XmlText & "<br>");

</cfscript>

It writes the expected result to the page. I want to instead create a variable of the result instead.

    This topic has been closed for replies.

    1 reply

    Inspiring
    November 20, 2010

    Refer to this thread.  http://forums.adobe.com/thread/754326?tstart=0

    Squiggy2Author
    Inspiring
    November 20, 2010

    Thanks, I remember it well

    Unfortunately I neglected to ask for clarification. I did not understand how

    s = "";

    for(){

         s &= "stuff to add to string here";

    }

    writeOutput(s);

    would help solve the issue. Worse, I wasn't sure where the heck to put that code...

    Community Expert
    November 20, 2010

    The variable "s" contains everything being written - if you don't want to write it, simply omit the writeoutput in the last line of the example.

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

    GSA Schedule, and provides the highest caliber vendor-authorized

    instruction at our training centers, online, or onsite.

    Read this before you post:

    http://forums.adobe.com/thread/607238

    Dave Watts, Eidolon LLC