webMathematica`

MSPSetDefault

MSPSetDefault[ var, value]

set the variable var to value if it does not have a value

Details

  • This is a utility function for setting the default values of variables.
  • The following exceptions can be thrown by MSPSetDefault.
  • MSPException["ParseError"]if the value cannot be interpreted by Mathematica
    MSPException["SecurityError"]if the value does not pass the security test
    MSPException["ValueError"]if the value is not a string, this indicates a programmatic error by the page author
    MSPException["VariableError"]if the variable is not a Mathematica symbol, this indicates a programmatic error by the page author

Examples

Basic Examples  (1)

You can simulate how the function works by installing and loading the package.

Here $$var has a value, so its value is not modified.

If $$var has no value, MSPSetDefault will set it.