This wiki is out of date, use the continuation of this wiki instead

FALSE

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:34, 1 May 2007 (edit)
FCR (Talk | contribs)

← Previous diff
Current revision (09:37, 17 July 2007) (edit) (undo)
Sandman (Talk | contribs)
(Definition)
 
(4 intermediate revisions not shown.)
Line 1: Line 1:
== Definition == == Definition ==
-'''INT''' False+'''INT''' FALSE
-False is a [[constant]] which is equal to every even integer. It is used to state that something is not [[true]].+False is a [[constant]] [[int]]eger, equal to the value 0. It is used to state that something is false and not [[true]].
 + 
 +Checking whether a variable is false, is the same as checking if it's zero. In older versions of [[Fenix]], it was the same as checking whether a variable is even. This has been changed because it's more commonly used.
== Example == == Example ==
<pre> <pre>
-VariableName = false;+Program example;
-if (variableName == false)+Private
- //do stuff+ int b = false;
-end+Begin
 + 
 + // comparison with the constant FALSE
 + if(b == false)
 + say("b was FALSE! so b==0");
 + else
 + say("b was not FALSE! so b!=0");
 + end
 + 
 + // checking the integer itself
 + if(!b)
 + say("b was false! so b==0");
 + else
 + say("b was true! so b!=0");
 + end
 + 
 + Loop
 + frame;
 + End
 + 
 +End
</pre> </pre>
[[category:constants]] [[category:constants]]

Current revision

[edit] Definition

INT FALSE

False is a constant integer, equal to the value 0. It is used to state that something is false and not true.

Checking whether a variable is false, is the same as checking if it's zero. In older versions of Fenix, it was the same as checking whether a variable is even. This has been changed because it's more commonly used.

[edit] Example

Program example;
Private
    int b = false;
Begin

    // comparison with the constant FALSE
    if(b == false)
        say("b was FALSE! so b==0");
    else
        say("b was not FALSE! so b!=0");
    end

    // checking the integer itself
    if(!b)
        say("b was false! so b==0");
    else
        say("b was true! so b!=0");
    end

    Loop
        frame;
    End

End
Personal tools