Re: What's the Best Way?

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Thu, 15 Jun 2000 22:11:39 -0500, C. K. Lester wrote:

>Thanks Brian B and Matthew L!
>
>Your input is helpful. I figured the "routine_id" route would be the best
>way to go, but I had already gone this route and wanted to get the ideas in
>concrete before changing the paradigm. Did I say that right?
>
>Anyway, thanks, again, for your input. I'm going to start converting the
>stuff to functions, then I'll figure out how to use the routine_id stuff.
>Is the routine_id stuff crossplatform? For some reason, I thought that
>stuff was Win32 only...?

'routine_id' is platform independent but in my experience is really only
necessary in situations where your library needs to call a routine provided
by a user of the library (a situation where your library does not know what
the function is).  This is why it's frequently used in Win32lib.  Win32lib
calls event functions that are provided by the user (onOpen, onPaint,
onMouse, onClick, etc.).  If your library does not need to use routines
created by the user (routines defined later in the program) then you should
not need to use it.  Simply define the functions that the user can access
as 'global'.  Routines that are intended to be used only by the libary
(e.g. helper routines that might be used by more than one global routine)
should *not* be declared 'global'.

Hope this clears things up if you weren't too sure about it.  Check the
reference manual on 'routine_id' for other possible uses (which includes a
link to a comprehensive discussion of 'scope' in section 2.4.2).

Good luck,
Brian

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu