About: Conditional   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

A conditional is an expression used to decide between two possible courses of action. This often means a branching structure (two courses of action that end at the same spot, e.g. an "if" statement), but is also at times be used to describe the controlling expression of a loop (where one course of action ends back at the conditional).

AttributesValues
rdfs:label
  • Conditional
rdfs:comment
  • A conditional is an expression used to decide between two possible courses of action. This often means a branching structure (two courses of action that end at the same spot, e.g. an "if" statement), but is also at times be used to describe the controlling expression of a loop (where one course of action ends back at the conditional).
sameAs
dcterms:subject
abstract
  • A conditional is an expression used to decide between two possible courses of action. This often means a branching structure (two courses of action that end at the same spot, e.g. an "if" statement), but is also at times be used to describe the controlling expression of a loop (where one course of action ends back at the conditional). NWScript conditionals must have an integer value, with zero being interpreted as "no" or "false" and non-zero values interpreted as "yes" or "true". This may not be clear to beginner scripters, as a conditional will often take the form of a comparison, as in "is this variable equal to 3?" which does not initially appear to be an integer expression. However, the comparison operators (==, !=, <, <=, >, >=) do in fact evaluate to 1 (for truth) or 0 (for falsity). For convenience, NWScript provides two constants — TRUE and FALSE — that can be used as the return value of functions intended for use in conditionals. These constants do not have to be used, though, as such functions can return any expression that could be placed directly in a conditional, and sometimes using such an expression is more convenient than using the constants. In addition, these constants usually do not need to be checked explicitly as they already have values suitable for use in a conditional. (Some BioWare scripts do perform these steps, even when they are unnecessary.) Examples: // Long way to return TRUE or FALSE. if ( nInteger == 3 ) return TRUE; else return FALSE; // Short way to return TRUE or FALSE. return nInteger == 3; // Long way to check a return value for truth. if ( GetIsDawn() == TRUE ) // Short way to check a return value for truth. if ( GetIsDawn() )
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software