daz
 Joined: Jul 2010
Posts: 167
|
 |
Posted on: June 21, 2014, 06:29:16 AM |
|
|
|
I am using latest portable exe (from 6/19) and it appears (user-defined) constants don't work! All constant values are null when I try to print them.
Can these get implemented or fixed?
xoxo, Daz
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #1 Posted on: June 21, 2014, 07:49:22 AM |
|
|
Use Enumerations QuoteEnumerations
As in ISO C++, enumeration values are to be regarded as strict constants. When values are specified, they should be evaluable at the time of parse. A sample enumeration is as follows: enum { a, b, c, d = 10, e, f } In the above enumeration, as per ISO C++, the values of a, b, c, d, e and f are respectively 0, 1, 2, 10, 11, 12. These values should be assigned by the language-independent lexer upon initial parse. The assignment operand for initialized constants is to be regarded as a single token, though it may contain more complex expressions provided that these expressions do not entail runtime computations. As with EDL structures, EDL enumerations need not be followed by a semicolon, as declarations using the new type must be made separately.
Declarations of enumerations are currently not possible in scripts or objects, however you can include them in definitions, under ENIGMA settings. http://enigma-dev.org/docs/Wiki/ENIGMA:Specification
|
|
|
daz
 Joined: Jul 2010
Posts: 167
|
 |
Reply #2 Posted on: June 21, 2014, 11:24:09 AM |
|
|
|
While this might be a reasonable substitute, I cannot get it to work either.
enum { UP, DOWN, LEFT, RIGHT, NONE }
Error:
In file included from SHELLmain.cpp:98:0: Universal_System/syntax_quirks.h:18:2: error: multiple types in one declaration };
|
|
|
egofree
 Joined: Jun 2013
Posts: 601
|
 |
Reply #3 Posted on: June 21, 2014, 01:33:37 PM |
|
|
If found the problem : it seems enum declarations works only on one line and with a semi-colon at the end. If you try : enum {UP, DOWN, LEFT, RIGHT,NONE};It should work. Don't ask me why, i didn't make the parser ! 
|
|
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
Reply #5 Posted on: June 21, 2014, 06:22:52 PM |
|
|
|
The parser in the other branch allows enums to be inline in EDL. The wiki page was written for that.
|
|
|
TheExDeus
 Joined: Apr 2008
Posts: 1,860
|
 |
Reply #6 Posted on: June 21, 2014, 06:54:18 PM |
|
|
|
When will you finish it and merge it? :|
|
|
|
|
|
|
|
|