Articles Archive
Director Forums
Director Wiki
Job Board
Search
 
 Director Online WikiMain Page | About | Help | FAQ | Special pages | Log in | Printable version | Disclaimers

VOID

From Director Online Wiki

A special constant in Lingo: VOID is the source of much confusion because it is both a value and a type. VOID has a number of unique properties:

  • The type VOID can have only one value: VOID.
  • VOID is numerically equivalent to zero (in most cases, see below --Julian Beak 19:40, 22 Jun 2005 (MDT))
  • VOID is the default value assigned to global variables and properties that have not been explicitly set to anything.

You should always to see whether a value is VOID by using voidP, or testing whether its [ilk] is #void.

The special case where void does not behave numerically equivalent to zero is when you are trying to compare it using greater than (>) in the expression. The example below will yield the following results in the message window:

put ( 0 = 0 )
-- 1
put ( Void = 0  )
-- 1
put ( Void < 1  )
-- 1
put ( 0 > -1 )
-- 1
put ( Void > -1 )
-- 0

Retrieved from "http://www.director-online.com/dougwiki/index.php/VOID"

This page has been accessed 1260 times. This page was last modified 01:40, 23 Jun 2005.