Help with "ERROR: Global (variablname) already defined"

Fairlight fairlite at fairlite.com
Tue Jul 24 11:53:06 PDT 2007


This public service announcement was brought to you by Boaz Bezborodko:
> I'm calling another table from within and input program and I want to 
> pass a variable.  The called program has the variable defined as DECLARE 
> GLOBAL while the program that is calling it has it defined as DECLARE 
> EXTERN.  Is this why I'm getting the error?  Are these supposed to be 
> reversed?

You do have them reversed.

PARENT TABLE:  DECLARE GLOBAL

CHILD TABLES:  DECLARE EXTERN

Note that the declarations do -not- indicate which way the data flows.  If
you declare TestBlurb as a global in prc.input and call prc.whatsit where
it's declared extern, if you modify it in whatsit, the modified value is
available to input upon return.  I use this all the time to set variables
from centralised init modules.

The global declaration must be in the parent because that's the first table
fP sees, and it needs to know what it's doing with it...extern basically
says, "look at what's already in memory for the definition of this
variable" which isn't possible if you're a parent table since you wouldn't
declare twice in the same table.

Hope that helps.

mark->
-- 
The latest synth mixdown...
http://media.fairlite.com/Isolation_Voiceless_Cry_Mix.mp3


More information about the Filepro-list mailing list