Assertions: Difference between revisions

413 bytes removed ,  8 years ago
→‎{{header|Axe}}: Updated example to be shorter and to always exit the global scope
(Added Axe)
(→‎{{header|Axe}}: Updated example to be shorter and to always exit the global scope)
Line 81:
 
=={{header|Axe}}==
<lang axe>Return!If A=42??Returnʳ</lang>
This example will exit the current scope. If it exists in the global scope, the program will exit, but if it exists within a function call, the function will return.
<lang axe>Return!If A=42</lang>
 
Alternatively, this example defines an ASSRT function which forces the program to exit. Note the superscript r on the first Return statement, which is what forces the program to terminate.
<lang axe>Lbl ASSRT
!If r₁
Returnʳ
End
Return</lang>
 
=={{header|BBC BASIC}}==
Anonymous user