Maxscript weirdness... maybe scope issues?

I have a macro script. It does this:

try (HideFlagsDialog.Dialog.Close()) catch()
	
fn BuildStructs = 
(
	format "Inititializing...
"
	filein @"C:\art\MaxScripts\MetaDataStruct.ms"
	format "MetaDataStruct loaded.
"
	filein @"C:\art\MaxScripts\UtilitiesStruct.ms"
	format "UtilitiesStruct loaded.
"
	filein @"C:\art\MaxScripts\DatabaseStruct.ms"
	format "DatabaseStruct loaded.
"
	filein @"C:\art\MaxScripts\HideFlagsDialogStruct.ms"
	format "HideFlagsDialogStruct loaded.
"
)
	
BuildStructs()
HideFlagsDialogStruct.Init()
HideFlagsDialog.Show()

For some reason, it fails on the second to last line, telling me that HideFlagsDialogStruct is undefined. However, I can immediately type into the listener “HideFlagsDialogStruct” and it will show me the struct definition. It’s quite obviously in memory by this point. (I realize that the last line seems to use an undefined variable, but the Init function before it declares a global variable HideFlagsDialog which is supposed to be an instance of the HideFlagsDialogStruct)

Why is this failing?

seams to be a variable scope issue…

try

::HideFlagsDialogStruct.Init()

most probably the HideFlagsDialogStruct var gets defined after the macro…

[QUOTE=RappyBMX;24757]seams to be a variable scope issue…

try

::HideFlagsDialogStruct.Init()

most probably the HideFlagsDialogStruct var gets defined after the macro…[/QUOTE]

Thanks! That fixed things. I still don’t understand why I’m having a scope issue, but that does seem to be the issue.

can you attach the scrips, please