Toggle command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "__TOC__ {| |width="50%"| '''Action:''' |width="50%"| <span class="f_Para">Reverses the state ("True" or "False") of a working_with_macro_variables.html|...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


{|
{|
|width="50%"| '''Action:'''
|width="125px"| '''Action:'''
|width="50%"|
|width="575px"|
<span class="f_Para">Reverses the state (&quot;True&quot; or &quot;False&quot;) of a [[working_with_macro_variables.html|macro variable]]. If the variable value is </span><span class="f_Monospace">0</span><span class="f_Para"> or a zero length (null) string, or if it is undefined, its state is considered to be </span><span class="f_Monospace">False.</span><span class="f_Para"> For all other values, its state is considered to be </span><span class="f_Monospace">True.</span><span class="f_Para"> </span>
<span class="f_Para">Reverses the state (&quot;True&quot; or &quot;False&quot;) of a [[Working with macro variables|macro variable]]. If the variable value is </span><span class="f_Monospace">0</span><span class="f_Para"> or a zero length (null) string, or if it is undefined, its state is considered to be </span><span class="f_Monospace">False.</span><span class="f_Para"> For all other values, its state is considered to be </span><span class="f_Monospace">True.</span><span class="f_Para"> </span>


<span class="f_Para">The </span><span class="f_Monospace">toggle</span><span class="f_Para"> command sets to 0</span><span class="f_DefListDDTable"> </span><span class="f_Para">(&quot;toggles to False&quot;)</span><span class="f_DefListDDTable"> </span><span class="f_Para">a variable whose state is True</span><span class="f_DefListDDTable">. </span><span class="f_Para">And it sets to 1 (&quot;toggles to True&quot;) a variable whose state is False. </span>
<span class="f_Para">The </span><span class="f_Monospace">toggle</span><span class="f_Para"> command sets to 0</span><span class="f_DefListDDTable"> </span><span class="f_Para">(&quot;toggles to False&quot;)</span><span class="f_DefListDDTable"> </span><span class="f_Para">a variable whose state is True</span><span class="f_DefListDDTable">. </span><span class="f_Para">And it sets to 1 (&quot;toggles to True&quot;) a variable whose state is False. </span>
Line 16: Line 16:
*''&amp;var'' is a macro variable that may or may not already exist.  
*''&amp;var'' is a macro variable that may or may not already exist.  
*''msg_string'' is an optional message string, useful for constructing a  message to report what was toggled.  
*''msg_string'' is an optional message string, useful for constructing a  message to report what was toggled.  
 
If ''msg_string'' is specified, either of the following is displayed in the [[Status bar|Status bar]] after the toggle:
If ''msg_string'' is specified, either of the following is displayed in the [[glance_at_status_area.html|Status bar]] after the toggle:
&quot;''msg_string'' is on &quot; (if toggled on)  
 
&quot;''msg_string'' is off &quot; (if toggled off)  
&quot;''msg_string'' is on &quot; (if toggled on)  
 
&quot;''msg_string'' is off &quot; (if toggled off)  


Example:  
Example:  
<p class="syntax"># toggle history</p>
<p class="syntax"># toggle history</p>
<p class="syntax">toggle &amp;historyWanted Auto History </p>
<p class="syntax">toggle &amp;historyWanted Auto History </p>

Latest revision as of 19:07, 9 February 2023

Action:

Reverses the state ("True" or "False") of a macro variable. If the variable value is 0 or a zero length (null) string, or if it is undefined, its state is considered to be False. For all other values, its state is considered to be True.

The toggle command sets to 0 ("toggles to False") a variable whose state is True. And it sets to 1 ("toggles to True") a variable whose state is False.

Syntax:

toggle &var[msg_string]

where:

  • &var is a macro variable that may or may not already exist.
  • msg_string is an optional message string, useful for constructing a  message to report what was toggled.
If msg_string is specified, either of the following is displayed in the Status bar after the toggle:
"msg_string is on " (if toggled on)
"msg_string is off " (if toggled off)

Example:

# toggle history

toggle &historyWanted Auto History 

Client menu: --
Introduced: Build 37