Dimenticare icon

Enum error errors

Dimenticare | PRO | 12/29/15 11:06:53 PM UTC | 0 ⭐ | 10492 👁️ | Never ⏰ | []
Game Maker |

0 B

|

None

|

0 👍

/

0 👎

/// errorPart1()
 
/* Declared in the Macros/Constants menu:
 *  M1=1
 *  M2=2
 *  M3=3
 */
 
// these are obviously duplicates; the compile error
// will always point to "line 0" (line 1 in the script
// editor), even though that line is a comment and the
// actual error is at line 16 (line 17 in the editor).
 
enum test {
    M1,
    M2,
    M3
}
 
enum test2 {
    a,
    b,
    c
}
 
/// errorPart2()
 
// This results in a "case argument must be constant"
// error, even though the code itself is fine
 
switch (irandom(10)){
    case test2.a:
        show_debug_message("...");
        break;
    case test2.b:
        show_debug_message("...");
        break;
    case test2.c:
        show_debug_message("...");
        break;
}
 
// This results in a "malformed assignment statement"
// error, even though the assignment statement itself
// is fine and the real error is in the enum declaration
 
var blah=test.M1;

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎