[SOLVED] - Undeclared identifier weird error

Posted By: CyberGhost

[SOLVED] - Undeclared identifier weird error - 07/10/15 11:26

I made a panel to set the settings of my game. There's a function that saves the changes I've made in the settings (sound volume, ... etc.) into a text file. The problem is that the engine says that some variables are 'undeclared identifiers' although they are declared ...

It was working fine all the time ,and that happened when I changed some stuff in another script file that has nothing to do with the settings ....

Here's the function that saves the settings:

Code:
var settings_file_handle; //the problem is not with that variable, it is the next four variables 
var music_volume;
var sfx_volume;
var music_playable;
var sfx_playable;


function save_settings()
{
	
	
	
	settings_file_handle = file_open_write("settings.txt");
	   
	   //window/fullscreen
	   
	   file_var_write(settings_file_handle,video_screen);
	   
	   //Resolution
	   
	   file_var_write(settings_file_handle,video_mode);
	   
	   //MUSIC
	   
	   file_var_write(settings_file_handle,music_playable);
	   file_var_write(settings_file_handle,music_volume);
	   
	   //SFX
	   
	   file_var_write(settings_file_handle,sfx_playable);
	   file_var_write(settings_file_handle,sfx_volume);
	   
	   file_close(settings_file_handle);
}




Thank you and any help will be appreciated
Posted By: Superku

Re: Undeclared identifier weird error - 07/10/15 11:55

Where exactly do you get the error message, on script compiling? Can you write down the exact error message?
Do you have the variables declared before the function like in your post (maybe you have two save_settings() functions in your script)?
Posted By: CyberGhost

Re: Undeclared identifier weird error - 07/10/15 12:35

Originally Posted By: Superku
Where exactly do you get the error message, on script compiling?


Yes, while compiling.

Originally Posted By: Superku
Can you write down the exact error message?




Originally Posted By: Superku
Do you have the variables declared before the function like in your post (maybe you have two save_settings() functions in your script)?


Yes, it is. I have only one function. Btw., everytime I comment out the line that uses the variable, it tells me that another one is undeclared identifier. And then I comment it out, then it tells me that the panel itself (that was actually defined before the function too) is undeclared. I re-installed 3DGS ,but the problem persists. I have A8 v8.10.3 btw.
Posted By: CyberGhost

Re: Undeclared identifier weird error - 07/10/15 12:47

Sorry, it turned out to be a missing-bracket typo grin
© 2024 lite-C Forums