comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Best way to share 'enum' between various functions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Best way to share 'enum' between various functions [message #77908 is a reply to message #77789] Mon, 26 September 2011 17:28 Go to previous message
SonicKenking is currently offline  SonicKenking
Messages: 51
Registered: October 2010
Member
On Sep 24, 6:24 pm, Robin Wilson <ro...@rtwilson.com> wrote:
> Hi all,
>
> I have a number of constant definitions that I'm using to do what an
> enum would do in other languages:
>
> MARITIME = 1
> CLOUD = 2
> URBAN = 3
> ...
>
> I want these definitions to be available to a lot of different functions
> and procedures (all in different files) in my code - they are used a lot
> in IF statements and various assignments.
>
> Obviously I don't want to replicate the definitions in loads of
> different files, as if I ever change them (or add extra ones) then it
> will get *very* confusing.
>
> What's the best way to do this?
>
> Cheers,
>
> Robin
>
> ------------------
> Robin Wilson
> A PhD student studying complexity in remote sensingwww.rtwilson.com/academic

Define the variables in it's own file, say the file is "myconst.pro".
In other routines, use @myconst to include the variables, similar to C
header files.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Strange behavior of POLYFILL
Next Topic: map_set issue

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 08:02:33 PDT 2025

Total time taken to generate the page: 0.38364 seconds