Programmer Guide/Command Reference/SET: Difference between revisions
From STX Wiki
Jump to navigationJump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
{{Command Reference}} | |||
<var>var</var> := SET anyvalue | <var>var</var> := SET anyvalue | ||
Line 9: | Line 10: | ||
For the curious: The keyword <code>SET</code> 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 <code>SET</code> keyword.'' | For the curious: The keyword <code>SET</code> 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 <code>SET</code> keyword.'' | ||
The <code>SET</code> command is also used to modify [[Programmer Guide/Shell Items|shell items]]. These <code>SET</code> commands are documented with the associated item type. |
Revision as of 09:55, 13 May 2015
var := SET anyvalue
Assign a value to a variable. For example:
#question := set 'How much wood would a wood chuck chuck?'
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.