>From: Robert Wingate <[EMAIL PROTECTED]>
>Subject: RE: <lingo-l> #define
>
>> Is there anyway to do a #define in Lingo (D7) rather than
>> just assign a variable a value?
>
>Short answer: since Director doesn't use a preprocessor, no. But isn't doing
>a #define the same as assiging a value to variable in the preprocessor?

Not really. A #define is a constant, not a variable. If I recall correctly,
#define statements are technically macros and can be used to replace code
in-line.

Lingo has something akin to enumerated types in its use of symbols. They
can sometimes be used in place of a #define, like this:
(Untested off the top of my head)

on startMovie
  if checkVersion() = #old then
    alert "You need a later version of Director for this example"
  end if

end

on checkVersion
  if integer(char 1 of the productVersion) > 7 then
    return #okay
  else
    return #old
  end if
end checkVersion

Not that you don't manually "define" the symbols #old and #okay. You just
use them like constants and director handles the housekeeping.

Cheers,
Bruce

Bruce Epstein, Zeus Productions, [EMAIL PROTECTED], 732-940-2800
Check out LAST CALL - The Ultimate Bartending Sim:
http://www.zeusprod.com/games/lastcall.html
--------
Director and Lingo in a Nutshell (DiaN/LiaN) kick butt.
Free Sample Chapters: http://www.zeusprod.com/nutshell/downloads/
--------



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to