Wafl Home

Primitive Data Types Tutorial

Conversions to Bool Type

Function asBool(x) converts any non-zero numerical value x to true and zero values to false.

Function asBool(x) converts string values "true" and "T" to true, and each of other values to false.

Source code:

{#
asBool( -3 ),
asBool( 0 ),
asBool( 2.1 ),
asBool( 0.0 ),
asBool( -3.2 ),
asBool( "true" ),
asBool( "True" ), // this is not same as "true"
asBool( "T" ),
asBool( "t" )     // this is not same se "T"
#}

Result:

{# true, false, true, false, true, true, false, true, false #}

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.