EnvironmentVariableEditor
The EnvironmentVariableEditor is a function of the ThereClient’s System Cockpit which allows you to query and set the values of certain variables in ThereClient to affect its behaviour.
To query the value of a variable, put its name in the first field and click the “query” button. The variable’s name will appear in both “variable” fields and its current value, if any, appears in the “value” field. Variables are shown as “(not set)” until you or a system event assigns a value.
To set the value of a variable, put its name in the second “variable” field, put the required value in the “value” field and click the “modify” button. Both predefined and “on-the-fly” variables can be set through this mechanism.
Some known predefined variables…
These are created by assigning a value to them…
- myFoo
- myBar
Note that variable names are case significant: setting “HostHud” to 1 will not have the same effect as modifying “hostHud”.
You can change a variable’s type from integer to double and vice-versa by adding or removing a decimal point, but you cannot change from a string to a number or vice-versa unless you also select the “Override the type?” checkbox.
You can set variables from an external program by performing a GET on an appropriate URL. For example, to set variable A to value B, you could perform a GET on:
http://localhost:9999/environment/top?variable=A&value=B&modify=
You could read the value of a variable in a similar way, but you would have to scrape the variable’s value out of the HTML produced by the debug host. The appropriate URL is:
http://localhost:9999/environment/top?variable=A
The resulting HTML looks like this (V2.06):
<HTML>
<h3>There Environment Variable Editor</h3>
<FORM METHOD=GET ACTION=/environment/top>
Variable: <INPUT NAME=variable SIZE=20 VALUE=A><br>
<INPUT TYPE=SUBMIT VALUE=query>
</FORM>
<FORM METHOD=GET ACTION=/environment/top>
Variable: <INPUT NAME=variable VALUE=A SIZE=20><br>
Value: <INPUT NAME=value SIZE=20 VALUE=1><br>
<INPUT TYPE=hidden NAME=modify><br>
<INPUT TYPE=SUBMIT VALUE=modify>
</FORM>
</HTML>
Note that this is, unfortunately, not valid XML. If you ask for the value of an unset variable, you get a result like this:
<HTML>
<h3>There Environment Variable Editor</h3>
<FORM METHOD=GET ACTION=/environment/top>
Variable: <INPUT NAME=variable SIZE=20 VALUE=asdasd><br>
<INPUT TYPE=SUBMIT VALUE=query>
</FORM>
<FORM METHOD=GET ACTION=/environment/top>
Variable: <INPUT NAME=variable VALUE=asdasd SIZE=20><br>
Value: <INPUT NAME=value SIZE=20 VALUE="(not set)"><br>
<INPUT TYPE=hidden NAME=modify><br>
<INPUT TYPE=SUBMIT VALUE=modify>
</FORM>
</HTML>
Note that the necessary quotes have now been inserted into the output.
See: EnvironmentVariables