Notifications
Clear all

[Closed] Global Variable Declaration

I’m having some weirdness with delaring a global variable. First, this is basically how the script is setup:


global sak_INIfile = "c:\\directory\\someINIfile.ini"
global sak_floatername
global sak_ui_function
 
fn sak_ui_function = (
  rollout firstRollout "name" (
	...
	< using ini variable in here >
  )
  rollout secondRollout "name2" (
	...
	< using ini variable in here too >
  )
)

Now upon executing the script, anywhere I try and use the variable with “getINIsetting” it says that the “sak_INIfile” variable is undefined. But, if I manually declare the global in the listner, the script works fine. Also, if I declare the variable locally in the rollout the script works fine. I don’t want to do that though because I’m using it in multiple rollouts.

Anyone have any clues as to why this is happening?

Thanks for reading,
Stev

1 Reply

I have no problems evaulating and printing the value of sak_INIfile after this is initialized on my 32bit max9.