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

Home » Public Forums » archive » Re: global singleton object ?
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: global singleton object ? [message #26891 is a reply to message #26887] Wed, 03 October 2001 06:11 Go to previous messageGo to previous message
R.G.S. is currently offline  R.G.S.
Messages: 46
Registered: September 2000
Member
Mark Hadfield <m.hadfield@niwa.cri.nz> wrote in message
news:004301c14b8b$e33233e0$d938a8c0@Hadfield...
>> So, is there a way to easily define the object, or do I simply create it
>> upon startup of my IDL and define it to a system variable?
>
> Remember that functions are global in IDL.
>
> Write a function that creates your settings object and assigns it to a
> system variable. On every entry to the function, check whether the system
> variable exists and points to a valid object. If it does, use that object.
>
> I'm sure there are other ways to do this, and some of them may even be
> better than this one!
>
> ---
> Mark Hadfield
> m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
> National Institute for Water and Atmospheric Research


Yes, that is what I have done (a procedure actually).
In every routine that I use the object, I first call a "object_initialize"
procedure that starts the object if it does not already exist.
That seems to be the way to go with using a "fake" singleton object.
(of course, the main code destroys the object when it cleans up)



Cheers,
bob
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using IDL with Java
Next Topic: Re: happy palindrome day - and a challenge

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

Current Time: Sat Oct 11 05:43:58 PDT 2025

Total time taken to generate the page: 0.16031 seconds