Outputting to a variable file name or inc session variables

Im trying to tweak my interperated java script to either output scrape data to a session variable file name or include the session variable in the output file. I have the following for inc a session variable in one file:-

FileWriter out = null;

try
{
session.log( "Writing data to a file." );

// Open up the file to be appended to.
out = new FileWriter( "CA.txt", true );

// Write out the data to the file.
out.write( dataRecord.get( "cacode" ) + "\t" );
out.write( dataRecord.get( "VALUE" ) + "\t" );
out.write( Session.getVariable( ~@Town@~ )

out.write( "\n" );

// Close up the file.
out.close();
}
catch( Exception e )
{
session.log( "An error occurred while writing the data to a file: " + e.getMessage() );

can anybody help to what is the correct syntax for both?

thanks......Kerri

Outputting to a variable file name or inc session variables

Hi,

Instead of this:


out.write( Session.getVariable( ~@Town@~ ))

Try this:


out.write( session.getVariable( "Town" ))

Kind regards,

Todd Wilson