Working with Client functions (Debugger): Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
<span class="f_Para">Client function names begin with two ampersand (&amp;&amp;) characters; those characters must be followed by one alphabetic character, which may be followed by one or more alphanumeric characters and underscores. </span>
<span class="f_Para">Client function names begin with two ampersand (&amp;&amp;) characters; those characters must be followed by one alphabetic character, which may be followed by one or more alphanumeric characters and underscores. </span>


Client function arguments ''all'' have the same form: that is, they may be single- or double-quoted strings, numeric constants, or, as of Client Build 58, they may also be [[working_with_macro_variables.html|macro variables.]]  As of Build 69, they may be invocations of other &amp;&amp;functions.
Client function arguments ''all'' have the same form: that is, they may be single- or double-quoted strings, numeric constants, or, as of Client Build 58, they may also be [[Working with macro variables|macro variables.]]  As of Build 69, they may be invocations of other &amp;&amp;functions.


To see in a message box or the console a value returned by a function, you can assign it to a macro variable, then issue the [[varDump command|varDump]] command; or use the function with the [[echo command|echo]] command.
To see in a message box or the console a value returned by a function, you can assign it to a macro variable, then issue the [[varDump command|varDump]] command; or use the function with the [[echo command|echo]] command.


<span class="f_Subhead">Macro only functions </span>
==== Macro only functions ====


It may be that a &amp;&amp;function is '''''macro only''''': it may be used only in a [[using_debugger_macros.html|macro.]] The description of such a &amp;&amp;function includes a ''Scope'' section that reminds of this restriction.  
It may be that a &amp;&amp;function is '''''macro only''''': it may be used only in a [[Using Debugger Macros|macro.]] The description of such a &amp;&amp;function includes a ''Scope'' section that reminds of this restriction.  


<span id="string_functions" class="hmanchor"></span><span class="f_Subhead">String functions </span>
==== String functions ====


<span class="f_Para">The &amp;&amp;functions include a group of string manipulation functions, all of which follow these rules: </span>
<span class="f_Para">The &amp;&amp;functions include a group of string manipulation functions, all of which follow these rules: </span>

Latest revision as of 01:13, 23 May 2023

The available Debugger Client functions are described in individual sections that follow. The function names are specified without regard for case.

Client function names begin with two ampersand (&&) characters; those characters must be followed by one alphabetic character, which may be followed by one or more alphanumeric characters and underscores.

Client function arguments all have the same form: that is, they may be single- or double-quoted strings, numeric constants, or, as of Client Build 58, they may also be macro variables.  As of Build 69, they may be invocations of other &&functions.

To see in a message box or the console a value returned by a function, you can assign it to a macro variable, then issue the varDump command; or use the function with the echo command.

Macro only functions

It may be that a &&function is macro only: it may be used only in a macro. The description of such a &&function includes a Scope section that reminds of this restriction.

String functions

The &&functions include a group of string manipulation functions, all of which follow these rules:

  • The first character in a string occupies position 1, the second occupies 2, and so on.
  • If a function searches for and returns the position of a desired string within a target, it returns 0 if the searched-for string is not found.
  • If a function takes a position or length as an argument, and the argument value that is passed is non-numeric, an error is issued and the command that references the function is aborted.
  • If a number is passed for a parameter that is a string, the number is converted to a string. For example, 1234 is treated like '1234'.
  • Character matching is case sensitive.
  • Like all &&functions, arguments may be single- or double-quoted strings,  numeric constants, or &variables.