MSPSetDefault


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

DetailsDetails

  • 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

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

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

In[1]:=
Click for copyable input

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

In[2]:=
Click for copyable input
Out[2]=

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

In[3]:=
Click for copyable input
Out[3]=
New to Mathematica? Find your learning path »
Have a question? Ask support »