GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • Download
  • Reference
  • Environment
  • Libraries
  • Tools
  • Wiki
  • Tutorials
  • Examples
  • Books
  • Forum
  • Overview
  • People
  • Privacy

This view

  • Original page
  • New address

GeezerVison is showing processing.org — || (logical OR) / Reference

Reference+
Documentation→Reference→Control→Logical Operators

Name

|| (logical OR)

Description

Compares two expressions and returns true if one or both evaluate to true. Returns false only if both expressions are false. The following list shows all possible combinations:

true || false // Evaluates true because the first is true
false || true // Evaluates true because the second is true
true || true // Evaluates true because both are true
false || false // Evaluates false because both are false

Examples

  • size(400, 400);
    
    for (int i = 20 ; i <= 380; i += 20) {
      if ((i < 140) || (i > 240)) {
        line(120, i, 320, i);
      }
    }

Syntax

  • expression1 || expression2

Parameters

  • expression1any valid expression
  • expression2any valid expression

Related

  • logicalAND
  • logicalNOT
  • if
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.