Page History
Introduction
Implementation
Receiving variables
Variables are provided by the associated environment variable.
...
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
package js7;
import java.io.FileWriter;
import java.io.IOException;
public class SetAndGetVariables {
protected void setVar(String name, String value) throws IOException {
try {
String tmpFileName = System.getenv("JS7_RETURN_VALUES");
FileWriter fw = new FileWriter(tmpFileName, true);
fw.write(name + "=" + value);
fw.close();
} catch (IOException ioe) {
System.err.println("IOException: " + ioe.getMessage());
}
}
protected String getVar(String name){
return System.getenv(name);
}
public static void main(String[] args) throws IOException {
SetAndGetVariables setAndGetVariables = new SetAndGetVariables();
System.out.println("var1=" + setAndGetVariables.getVar("var1"));
setAndGetVariables.setVar("var1", "newValue");
}
}
|
Introduction
...
Overview
Content Tools