syntax error: #define not supported in Lite-C?

Posted By: Ericmor

syntax error: #define not supported in Lite-C? - 05/08/11 00:56

Hello,
Iīm converting my old A7 .wdl scripts to the new A8 C-Lite lenguage, and runned into a bug.
In one of the scripts, iīm using a defined handle to control a save game panel, but engine crashes say that the handle line is a SYNTAX ERROR.
In the following code...
Code:
#define _modesave 0;
#define _modeload 1;

function MainButtoncontroller(BUTTONUMBER)
{
 if(BUTTONUMBER==1)
 {
	submenus=1;
	mode_saveload= _modesave;
	submenus_control();
	return;
 }
...
}


... the engine gives the following error:

ERROR in "systemmenu.c" line 265:
syntax error
< mode_saveload= _modesave;
>

Those defines arenīt used in Lite-C?!?
Is there a new way to write this syntaxes?
I couldnīt find anything in the manual, so any help is appreciated.
Thanks in advance.
Posted By: DJBMASTER

Re: syntax error: #define not supported in Lite-C? - 05/08/11 02:14

You have to remove the ';' in your #define directives. Keeping the ';' in would replace '_modesave' with '0;' instead of '0'. Remember directives aren't statements grin
Posted By: Ericmor

Re: syntax error: #define not supported in Lite-C? - 05/08/11 06:26

Thanks DJBMASTER!
...removing the ";"?!!
The hell?!? Lite-C is weirder than i tought!...
Posted By: alibaba

Re: syntax error: #define not supported in Lite-C? - 05/08/11 08:23

You have to remove them only in # funtions. i.e. #include , #define , #ifdef and so on.
Posted By: Widi

Re: syntax error: #define not supported in Lite-C? - 05/09/11 13:39

It is all in the manual... Please read it
© 2024 lite-C Forums