[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: globals() how does it work.
- From: Edgar Toernig <froese@...>
- Date: Wed, 21 Mar 2001 04:38:49 +0100
Jean Claude Morlier wrote:
> In the example above I try to assign my own globals but this don't work.
> I need to set for a time myGlobals and after restore initial globals.
> May be I don't do this in a fine way.
You just forgot to copy "tostring". It's used internally by print.
So print tries to call nil and by thus raises an error. And because
you didn't have an _ERRORMESSAGE and _ALERT you don't see this error.
To get it working just insert:
l.tostring = tostring -- converts print-args to strings
and to see error messages
l._ERRORMESSAGE = _ERRORMESSAGE -- generates error message
l._ALERT = _ALERT -- actually prints the message
PS: The for statement does not need the next function.