isFunctionDefined: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page isFunctionDefined to IsFunctionDefined without leaving a redirect: Converting page title to first-letter uppercase)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
isFunctionDefined(name)
isFunctionDefined(name)
</source>
</syntaxhighlight>


|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: isFunctionDefined("fizzlegwip")]
[r: isFunctionDefined("fizzlegwip")]
</source>
</syntaxhighlight>
Returns 0.
Returns 0.


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: defineFunction("myNewFunction", "myMacro@token")]
[h: defineFunction("myNewFunction", "myMacro@token")]
</source>
</syntaxhighlight>
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: isFunctionDefined("myNewFunction")]
[r: isFunctionDefined("myNewFunction")]
</source>
</syntaxhighlight>
Returns 1.
Returns 1.


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: isFunctionDefined("input")]
[r: isFunctionDefined("input")]
</source>
</syntaxhighlight>
Returns 2.
Returns 2.



Latest revision as of 23:59, 15 March 2023

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

isFunctionDefined() Function

Introduced in version 1.3b51
Checks if a function has been defined using defineFunction(). Returns true(1) if it has, or false(0) if it has not. Returns '2' if the entered function is a built-in MapTool function rather than a user-defined function.

Usage

isFunctionDefined(name)

Examples

[r: isFunctionDefined("fizzlegwip")]

Returns 0.

[h: defineFunction("myNewFunction", "myMacro@token")]
[r: isFunctionDefined("myNewFunction")]

Returns 1.

[r: isFunctionDefined("input")]
Returns 2.

See Also