Main Page About Ldoc+ Error Lists Main Index Index Groups

Ldoc+ Lingo Groups:
    CODE STRUCTURES / VARIABLES

 info D5/601:
      clearGlobals
 6    5 elements new in Director 6.0,
  !   6 contain Dictionary fixes 601 & 501,
   + 17 miss from the 'Appendix' 6.0 for CODE STRUCTURES,
   +  6 miss from the 'Appendix' 6.0 for VARIABLES.


Code Structures & Syntax (32):
  !   #  (symbol operator)
      -- (comment delimiter)
      ¬  (continuation symbol)
   +  abort
      case
x6 +  dontPassEvent (outdated -> stopEvent)
   +  end (of handler)
      end case
      end if
      end repeat
      exit
   +  exit repeat
      global
      if...then
      if...then...else
   +  next repeat
   +  nothing
   +  on (begin of handler)
   +  otherwise (case)
      pass  (also exits)
   +  property
      repeat while
      repeat with
   +  repeat with...down to
  !+  repeat with...in list
   +  result
   +  return()   (also exits)
 6 +  stopEvent  (without exiting)
   +  the
   +  while      (repeat while...)
 6!   VOID
   +  voidP()
      ...see also the OPERATORS Lingo Group,

Variables (12):
      clearGlobals
 6 +  externalParamCount()
 6 +  externalParamName()
 6 +  externalParamValue()
      global
   +  paramCount = paramCount()
   +  param()
      property
   +  put... (into Message window)
      set...to, set...=
      showGlobals
      showLocals
      ...see also the DATA TYPES Lingo Group.

--

Outdated CODE Lingo (1):
 6      put...into variable -> set variable to...





[index] _ D5/601 _ 971218:


clearGlobals

Lingo variables reset command

6.0 Dictionary Error, same in 5.0:

= Missing:
"See Also: global, VOID, voidP(), FALSE"
 --

"This command sets all user-defined global variables to 0."
= The 5.0 Dictionary should read:
"This command sets all user-defined global variables to '<Void>',
 which equals 'no value', not yet initialized, nothing,
 absolutely empty. Something 'Void' is also FALSE (0)."
 --

1. TIP: The 'clearGlobals' command sets all your user-defined global variables to the 5.0 expression '<Void>' or the 6.0 constant 'VOID' (no value, nothing), and after using this command, 'voidP(gGlobalVariable)' will result in TRUE. Something 'Void' is also FALSE (0).

2. TIP: In 6.0, issuing 'clearGlobals' sets 'the actorList = [ ]'. This differs from earlier versions of Director.

3. TIP: To only reset some of your global values to '<Void>', you can set them to a globally defined but unset variable like 'gVoid' that is still '<Void>' itself. In 6.0, you can use the new 'VOID' constant for this.

4. TIP: If some of your code depends on variables being void (evaluates to 0/FALSE), then don't forget to type a 'clearGlobals' in the Message window during author-time to empty all user-defined global variables (including 'the actorList' in 6.0) and reset your movie's Lingo for the next test run before playing the movie again.

--

EXAMPLE:

The following will work in a handler, using a global variable 'gVoid' which you never set, or the new 6.0 constant 'VOID':

global gGlobalVariable,gVoid
--
--> in 5.0:
put gVoid
-- <Void>

--> in 6.0:
put gVoid
-- Void
put (gVoid = VOID)
-- 1

put voidP(gVoid)
-- 1
put ilk(gVoid)
-- #void
put ilk(gVoid,#void)
-- 1
put ilk(gVoid) = #void
-- 1
put (gVoid = 0)
-- 1
put (gVoid = FALSE)
-- 1

set gGlobalVariable = FALSE
put gGlobalVariable
-- 0
put voidP(gGlobalVariable)
-- 0

set gGlobalVariable = gVoid
put gGlobalVariable
-- <Void>
put voidP(gGlobalVariable)
-- 1

--> in 6.0:
set gGlobalVariable = VOID
put gGlobalVariable
-- Void
put voidP(gGlobalVariable)
-- 1





[index] _ D5/601 _ 971201:


paramCount

handler parameters counting property

5.0 Dictionary Error, cleared in 6.0:
" Syntax: 'the paramCount' "
...should read:
" Syntax: 'the paramCount' or: 'paramCount()' "
...because the example uses 'paramCount()', and apparently both work!

"See Also" should mention 'param()'.





[index] _ D5/601 _ 971212:


repeat with...in list

code control structure

6.0 Dictionary Errors, same in 5.0:

"repeat with x in [1,2,3,4]
 put i"
= Should read:
"repeat with x in [1,2,3,4]
 put X"

"...evaluate the function in a loop
    with some type of counter..."
= I guess this should read:
"...evaluate the function in a FRAME loop
    with some type of counter..."

= Missing:
"See Also: exit repeat, next repeat, repeat while, [ ] list brackets"
 --





(Top)

URL = "http://www.a3w.de/Lingo/Ldoc_Code_Variables.html"  (971212)

 Top [Main Page] [About...] [Error Lists] [Ldoc+ Index] [Lingo Groups]
The Ldoc+ © Copyright 97-98 by Denis Wieger Online since June 1, 1997. All rights reserved.
<mailto:Denis@a3w.de>
 Top