Wikia

FiM++ Community Wiki

Changes: And

Edit

Back to page

m (Example: derp)
(formatting, new example!)
Line 4: Line 4:
   
 
== [[FDS]] ==
 
== [[FDS]] ==
 
 
{{See Also/small|Infix notation}}
 
{{See Also/small|Infix notation}}
   
{{codeblock|{{code|value|<value:'''boolean'''>}}{{tag|whitespace}}{{code|operator|and}}{{tag|whitespace}}{{code|value|<value:'''number'''>}}}}
+
{{codeblock|{{tag|value|boolean}}{{tag|whitespace}}{{code|operator|and}}{{tag|whitespace}}{{tag|value|number}}}}
   
 
=== Example ===
 
=== Example ===
+
{{codeblock|{{code|keyword|If}}{{code|whitespace| }}{{code|variable|I have no pants}}{{code|whitespace| }}{{code|operator|and}}{{code|whitespace| }}{{code|variable|I must scream}}{{code|whitespace| }}{{code|keyword|then}}{{code|punctuation|:}}{{code|whitespace| }}{{code|keyword|I would}}{{code|whitespace| }}{{code|method|scream without pants}}{{code|puncuation|.}}{{code|whitespace| }}{{code|keyword|That's what I would do}}{{code|punctuation|.}}}}
{{codeblock|{{code|keyword|I did this as long as}}{{code|whitespace| }}{{code|variable|Applejack}}{{code|whitespace| }}{{code|operator|is}}{{code|whitespace| }}{{code|literal|99}}{{code|whitespace| }}{{code|operator|and}}{{code|whitespace| }}{{code|variable|Spike}}{{code|whitespace| }}{{code|operator|is}}{{code|whitespace| }}{{code|literal|12}}{{code|punctuation|:}}
 
 
{{code|continuation|...}}}}
 
   
 
This loops the next part of code if the variable {{code|variable|Applejack}} is equal to {{code|literal|99}} and the variable {{code|variable|Spike}} is equal to {{code|literal|12}}.
 
This loops the next part of code if the variable {{code|variable|Applejack}} is equal to {{code|literal|99}} and the variable {{code|variable|Spike}} is equal to {{code|literal|12}}.
   
 
This is equivalent to the following '''Java''' code:
 
This is equivalent to the following '''Java''' code:
{{codeblock|<SOURCE LANG=java>while(Applejack==99&Spike==12) { ...</SOURCE>}}
+
{{codeblock|<SOURCE LANG=java>if (iHaveNoPants && iMustScream) { screamWithoutPants(); }</SOURCE>}}
   
 
== See Also ==
 
== See Also ==
Line 22: Line 21:
 
*[[Operators]]
 
*[[Operators]]
   
{{stub}}
 
 
{{Navbox/Phrases}}
 
{{Navbox/Phrases}}
  +
{{stub}}

Revision as of 01:03, November 20, 2012

The and operator is a boolean operator which returns <literal:true> only if all arguments are true, else returns <literal:false>.

Its token is named AND.

FDS

Icon Info
See Also: Infix notation

Example

If I have no pants and I must scream then: I would scream without pants. That's what I would do.

This loops the next part of code if the variable Applejack is equal to 99 and the variable Spike is equal to 12.

This is equivalent to the following Java code:

if (iHaveNoPants && iMustScream) { screamWithoutPants(); }

See Also


Icon Info
This article is a stub. You can help FiM++ Wiki by expanding it.

Around Wikia's network

Random Wiki