Page History
...
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 w.write(name + "=" + value + System.lineSeparator()); 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("var1VAR1")); setAndGetVariables.setVar("var1", "newValue"); } } |
Overview
Content Tools