Programmer Guide/Command Reference/SET: Difference between revisions

From STX Wiki
Jump to navigationJump to search
mNo edit summary
No edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{Command Reference}}
{{Command Reference}}
The <code>SET</code> command modifies the value of a variable or a [[Programmer Guide/Shell Items|shell item]].
  <var>var</var> := SET anyvalue
  <var>var</var> := SET anyvalue


Line 6: Line 8:


  <var>#question</var> := set 'How much wood would a wood chuck chuck?'
  <var>#question</var> := set 'How much wood would a wood chuck chuck?'
Modify a graph item:
SET $#graph BGCOLOR GRAY WHITE


Under certain conditions it is possible to omit the <code>SET</code> keyword altogether, but this is strongly discouraged because you can never be sure if these conditions apply (we can't either).
Under certain conditions it is possible to omit the <code>SET</code> keyword altogether, but this is strongly discouraged because you can never be sure if these conditions apply (we can't either).

Latest revision as of 09:57, 13 May 2015

The SET command modifies the value of a variable or a shell item.

var := SET anyvalue

Assign a value to a variable. For example:

#question := set 'How much wood would a wood chuck chuck?'

Modify a graph item:

SET $#graph BGCOLOR GRAY WHITE

Under certain conditions it is possible to omit the SET keyword altogether, but this is strongly discouraged because you can never be sure if these conditions apply (we can't either).

For the curious: The keyword SET may be omitted if (and only if) the first word of the value to assign is neither a built-in STx command nor the name of a macro, member function, and so on. Since this is nearly impossible to guarantee, we strongly encourage to never omit the SET keyword.

The SET command is also used to modify shell items. These SET commands are documented with the associated item type.

Navigation menu

Personal tools