set_sessionparameter (p, v)

The function set_sessionparameter (p, v) assigns the value v to the session parameter p. Session parameters can be used to store values between jobs which are associated with the same session.

Refer to chapter Using ITP/Server sessions for more information on sessions.

This function returns a value of type Boolean.

Example
Var Boolean Dummy = set_sessionparameter ("plugh", "plover");
Var Text X = get_sessionparameter ("plugh"); 	

Result: "plover"

Remarks

If the function succeeds, the return value is True. If the current script is not associated with a session, or if the function fails in some other way, an error is thrown. If ITP/Server has been instructed to ignore errors using the command OnError Script(*), and an error occurs, the function will return False, and the _error constant will be set to True.

To avoid the use of a dummy variable, the command SetSessionParameter can be used instead. Using this command, the above example becomes:

SetSessionParameter
  Par("plugh")
  Value("plover");
Var Text X = get_sessionparameter ("plugh"); 	

Result: "plover"