Re: Forward Referencing

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...

I'm intrigued: I cannot think of any reason why/where that would be useful, can you give an example?

Well here is one example.

public enum type SDL_Keymod 
	SDL_KMOD_NONE = 0x0000, 
	SDL_KMOD_LSHIFT = 0x0001, 
	SDL_KMOD_RSHIFT = 0x0002, 
	SDL_KMOD_LCTRL = 0x0040, 
	SDL_KMOD_RCTRL = 0x0080, 
	SDL_KMOD_LALT = 0x0100, 
	SDL_KMOD_RALT = 0x0200, 
	SDL_KMOD_LGUI = 0x0400, 
	SDL_KMOD_RGUI = 0x0800, 
	SDL_KMOD_NUM= 0x1000, 
	SDL_KMOD_CAPS = 0x2000, 
	SDL_KMOD_MODE = 0x4000, 
	SDL_KMOD_SCROLL = 0x8000, 
	 
	SDL_KMOD_RESERVED = SDL_KMOD_SCROLL 
end type 
 
--These should be part of the enum, but since forward referencing isn't allowed in Euphoria, I had to declare them outside of the enum 
 
public constant SDL_KMOD_CTRL = or_all({SDL_KMOD_LCTRL,SDL_KMOD_RCTRL}) 
public constant SDL_KMOD_SHIFT = or_all({SDL_KMOD_LSHIFT,SDL_KMOD_RSHIFT}) 
public constant SDL_KMOD_ALT = or_all({SDL_KMOD_LALT,SDL_KMOD_RALT}) 
public constant SDL_KMOD_GUI = or_all({SDL_KMOD_LGUI,SDL_KMOD_RGUI}) 

Maybe its not the biggest deal, but it would be nice to have.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu