Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Global Variables

1 replies · 1,690 views · Started 15 June 2005

I am having problems with defined GLOBAL variables.

e.g. I have defined a variable at the start of my main procedure

GLOBAL nInstall&

When I attempt to refer to this varaible in another procedure I get an "undefined variable" messgage when attempting to translate.

Can anyone help?

Hi Liam,

My guess is that you have added "DECLARE EXTERNAL" to the top of your program, hoping to catch undefined variables and procedures at translate-time rather than run-time.

The only problem with this approach is that you have to then declare each variable to the parser, using "EXTERNAL <variable>".

See the OPL Wiki definitions for these commands:

http://www.allaboutopl.com/wiki/OPLWikiHome

I hope this helps.

Jason