realbasic-plugins
[Top] [All Lists]

How to define constants?

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: How to define constants?
From: Marco Bambini <marco at sqlabs dot net>
Date: Fri, 16 Dec 2005 19:38:31 +0100
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
The REALconstant structure is defined as:

struct REALconstant
{
        const char *declaration;
        void* reserved1;
        int reserved2;
};

so I have written this:

REALconstant glConstants[] = {
        {"VERSION_1_4 = 1", NULL, 0},
        {"ACCUM = &h0100", NULL, 0},
        {"LOAD = &h0101", NULL, 0},
        {"RETURN = &h0102", NULL, 0},
        {"MULT = &h0103", NULL, 0},
        {"ADD = &h0104", NULL, 0},
        {"NEVER = &h0200", NULL, 0},
        {"LESS = &h0201", NULL, 0}
};

is this right?

It doesn't seems because RB gives me an error while using my plugin "cannot compile a constant with no name"

Please note that I define the module like:

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
};

and in PluginEntry I have:
REALRegisterModule(&GLModule);

P.S. Autocompletition in the IDE works fine

Any help?
---
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>