Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,119 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
syntax error: #define not supported in Lite-C? #369856
05/08/11 00:56
05/08/11 00:56
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
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.

Re: syntax error: #define not supported in Lite-C? [Re: Ericmor] #369860
05/08/11 02:14
05/08/11 02:14
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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

Last edited by DJBMASTER; 05/08/11 02:15.
Re: syntax error: #define not supported in Lite-C? [Re: DJBMASTER] #369862
05/08/11 06:26
05/08/11 06:26
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Thanks DJBMASTER!
...removing the ";"?!!
The hell?!? Lite-C is weirder than i tought!...

Re: syntax error: #define not supported in Lite-C? [Re: Ericmor] #369866
05/08/11 08:23
05/08/11 08:23
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
You have to remove them only in # funtions. i.e. #include , #define , #ifdef and so on.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: syntax error: #define not supported in Lite-C? [Re: alibaba] #369925
05/09/11 13:39
05/09/11 13:39
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
It is all in the manual... Please read it


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1