Working with Client functions (Debugger)

From m204wiki
Jump to navigation Jump to search

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.