Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Bugs and Fixes

enum error

A community discussion post from the original code:zIRON forum.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

enum error

Hi Mr Colin.

i have a problem with enum .see this gives error

//! Button ID for mouse devices
enum MouseButtonID
{
		MB_Left = 0, MB_Right, MB_Middle,MB_Button3, MB_Button4,MB_Button5, MB_Button6,	MB_Button7
}

error

[43,25]: Expected } or identifier but found 524288 in [MagicPro.zir] Code: MB_Left = 0, MB_Right, MB_Middle,MB_Button3, MB_Button4,MB_Button5, MB_Button6, MB_Button7,

also why ziron did not allow using the keytag of enum as a const in parameter declration.

e.g

cons myType = 0;

function bla(myType typ):int32; stdcall; this is okay

enum myTpye {
     a,b,c.....
}
function bla(myType typ):int32; stdcall; this is not okay

http://www.freewebs.com/ogremagic/index.htm

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

The problem is that one of the following:

MB_Right, MB_Middle,MB_Button3, MB_Button4,MB_Button5, MB_Button6,  MB_Button7

possible MB_Right or MB_Middle

is already declared somewhere, maybe in an include file?

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

i think you are correct.

thanks you.

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

as for the type enum, check samples (samples\enum\enum.zir) i think there is a sample of what you want to do :)