Property | Value |
rdfs:label | |
rdfs:comment | - The Broken {{ref}} (youtube link) Broken {{ref}} (youtube link) Broken {{ref}} (youtube link) is a vehicle in Saints Row IV.
- function Assert (string sMessage, int bValue, int bLog = FALSE) Internal function
* Return type: void
* Include file: nwscriptdefn
- This is a simple example about using asserts by Christopher Oliver, 24-May-2007 on Orangevolt that works in JFXPad. To do something with an assertion you use "assert" triggers: trigger on not assert assertion { throw "Assertion failed: {assertion}"; } trigger on assert assertion { println("Assertion passed: {assertion}"); } var a = [1,2]; assert sizeof a == 2; assert sizeof a == 1; compile thread: Thread[AWT-EventQueue-0,6,main] compile 0.0060 Assertion passed: Assertion {description: [] sourceURL: 'file:/Users/coliver/javafx/trunk/assert.fx' lineNumber: 10 assertion: 'sizeof a == 2' result: true} uncaught FX exception: 'Assertion failed: Assertion {description: [] sourceURL: 'file:/Users/coliver/javafx/trunk/assert.fx' lineNumber: 11 assertion: 'sizeof a == 1' result: false}' at throw "As
|
dcterms:subject | |
Large | |
steer angle | |
Hitpoints | |
front image | |
hostage class | |
steer speed | |
parked | |
vehicle class | |
convertible | |
Nitro | |
dbkwik:saintsrow/property/wikiPageUsesTemplate | |
Appearances | |
Speed | |
doors | |
Logo | |
Name | |
Torque | |
Caption | - The Assert in Saints Row IV
|
Mass | |
Law | |
Grip | |
Capacity | |
Image size | |
unlockable | |
vehicle style | |
abstract | - The Broken {{ref}} (youtube link) Broken {{ref}} (youtube link) Broken {{ref}} (youtube link) is a vehicle in Saints Row IV.
- This is a simple example about using asserts by Christopher Oliver, 24-May-2007 on Orangevolt that works in JFXPad. To do something with an assertion you use "assert" triggers: trigger on not assert assertion { throw "Assertion failed: {assertion}"; } trigger on assert assertion { println("Assertion passed: {assertion}"); } var a = [1,2]; assert sizeof a == 2; assert sizeof a == 1; compile thread: Thread[AWT-EventQueue-0,6,main] compile 0.0060 Assertion passed: Assertion {description: [] sourceURL: 'file:/Users/coliver/javafx/trunk/assert.fx' lineNumber: 10 assertion: 'sizeof a == 2' result: true} uncaught FX exception: 'Assertion failed: Assertion {description: [] sourceURL: 'file:/Users/coliver/javafx/trunk/assert.fx' lineNumber: 11 assertion: 'sizeof a == 1' result: false}' at throw "Assertion failed: {assertion}"; ("file:/Users/coliver/javafx/trunk/assert.fx", Line 2) You can have multiple such triggers. Also you can pass a description of the assertion like this: assert sizeof a == 1 : "This should fail: size = {sizeof a}"; The object passed to your trigger is an instance of the Assertion class which looks like this public class Assertion { public attribute description: String*; public attribute sourceURL: String?; public attribute lineNumber: Number; public attribute assertion: String; public attribute result: Boolean; } The value after the ":" in the assert statement (which may be a list of trings) will be assigned to the description attribute of the assertion bject passed to your triggers.
- function Assert (string sMessage, int bValue, int bLog = FALSE) Internal function
* Return type: void
* Include file: nwscriptdefn
|