MSPValue

MSPValue[var]
returns the value of var; it returns a null string if var has no value


returns the value of var; it returns def if var has no value

DetailsDetails

  • MSPValue is a utility function that is useful for extracting the value of variables.
  • The following exceptions can be thrown by MSPValue.
  • 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.

The value of the variable $$expr is returned.

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

If $$expr has no value, then a null string is returned.

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

Here a default value is returned.

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