realbasic-plugins
[Top] [All Lists]

Define constants, my experience for this list...

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Define constants, my experience for this list...
From: Marco Bambini <marco at sqlabs dot net>
Date: Sat, 17 Dec 2005 11:59:27 +0100
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
I think I have discovered a pattern for the IDE errors generated when you try to compile a plugin that defines constants (IDE is RB2005r4).

I am defining constants in this way:
REALconstant glConstants[] = {
        {"VERSION_1_4 = 1", NULL, 0},
        {"ACCUM = &h0100", NULL, 0}
};

and my module is:

REALmoduleDefinition GLModule = {
        kCurrentREALControlVersion,
        "GL",                 // name of module
        NULL,                   // list of methods
        0,                              // number of methods
        glConstants,    // list of constants
    sizeof(glConstants) / sizeof(REALconstant), // number of constants
};


IDE gives a "Cannot compile a constant with no name" error for every constant that begins with a number, for example:
{"2_BYTES = &h1407", NULL, 0},
{"3_BYTES = &h1408", NULL, 0},
{"4_BYTES = &h1409", NULL, 0},

For reserved RB words, for example:
{"TRUE = 1", NULL, 0},
{"FALSE = 0", NULL, 0},
{"RETURN = &h0102", NULL, 0},
{"SELECT = &h1C02", NULL, 0},
and so on
....the IDE gives a "Internal Error: An unhandled NilObjectException exception has occurred. Please report this to REAL Software..." so it seems a bug.

But the strangest thing is that not every "reserved" word seems to generate this error, because this constant:
{"DOUBLE = &h140A", NULL, 0},
compiles without any issue.

Hope my experience can help someone.
---
Marco Bambini
http://www.sqlabs.net
http://www.sqlabs.net/blog/



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>