Assert command: Difference between revisions
No edit summary |
No edit summary |
||
Line 29: | Line 29: | ||
*<span class="f_MonoItal">%</span><span class="term">x</span><span class="f_ListBul1"> is a mainframe variable. </span> | *<span class="f_MonoItal">%</span><span class="term">x</span><span class="f_ListBul1"> is a mainframe variable. </span> | ||
*<span class="f_ListBul1">g.</span><span class="term">x</span><span class="f_ListBul1"> is a Debugger [[ | *<span class="f_ListBul1">g.</span><span class="term">x</span><span class="f_ListBul1"> is a Debugger [[Watching global variables|global variable reference]]. </span> | ||
*<span class="f_ListBul1">f.</span><span class="term">x</span><span class="f_ListBul1"> is a Debugger [[ | *<span class="f_ListBul1">f.</span><span class="term">x</span><span class="f_ListBul1"> is a Debugger [[Watching Model 204 fields|field reference]], possibly with a subscript. </span> | ||
*<span class="f_ListBul1">$listcnt/$listinf are the Debugger functions for [[ | *<span class="f_ListBul1">$listcnt/$listinf are the Debugger functions for [[Watching $lists, Stringlists, and Arraylists|viewing $list counts and elements.]] </span> | ||
*<span class="f_ListBul1">&&</span><span class="term">function</span><span class="f_ListBul1"> is a macro function. </span> | *<span class="f_ListBul1">&&</span><span class="term">function</span><span class="f_ListBul1"> is a macro function. </span> | ||
*<span class="term">string</span><span class="f_ListBul1"> is a quoted string constant (double or single quotes are valid). </span> | *<span class="term">string</span><span class="f_ListBul1"> is a quoted string constant (double or single quotes are valid). </span> |
Revision as of 15:28, 26 November 2022
Action: |
Performs an equality or inequality comparison between a) the value of program data or a macro variable or Client function, and b) a constant or the value of a macro variable or macro function. For example: assert %i==666 This command lets you create simple testing macros that ensure that key elements in your code have the values you expect. If the comparison expression you construct with assert is not logically true, you receive a failure message. If true, you receive no confirmation. assert failure messages are displayed in the console, if it is open. Otherwise, they are displayed in a Windows message box. They have the following format: Assert failed: failing_assert_statement For example: Assert failed: assert &b = "no way" The assert command syntax follows: ASSERT {&var|%x|g.x|f.x|$listcnt(x)|$listinf(x,y)|&&function} {=|==|!=|<>} {string|[-]n|&var|&&function} where:
Here are examples of valid assert statements: assert g.JACK = "No play makes Jack a dull boy." ASSERt %s='Hey Moe' ASSERT $listcnt(%g)=2 ASSERT $listinf(%g,2) = " makes Jack a dull boy." assert &this = 'that' assert &this <> &that Notes:
<mapping command="assert &i<>6" button="button9"/> |
Client menu: | -- |
Introduced: | Build 28 |