Scope in multiple-module code

mjcoon

Well-Known Member
Licensed User
Arising from a question asked by another forum user, I realised I didn't know what the scope of a file's "connection name" is. I suspect it is Public (since there is no declaration for it), but it isn't mentioned in the Help topic for modules.

Similarly, I found that when I made a global variable into a Public one the initial value setting seemed to become a syntax error. I solved it by moving the initialisation into the App_Start, but that isn't an option for any module other than the Main one. Is this an intended restriction, and if so could it also be explicit in the help?

Mike.
 

mjcoon

Well-Known Member
Licensed User
To make a file connection public you will need to declare it as a global variable.

Can you post the 'syntax error' code ?

Thanks Erel, I would not have guessed that a file connection could or should be declared.

The "syntax error" as not (I discover when I re-try) at build time but at run time and the rather common but puzzling (to me!) message: "Input string was not in correct format" (as in thumbnail). As I said it works fine when I just have the plain public declaration in the Globals and the initialisation in the App_Start.

Mike.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…