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

Home » Public Forums » archive » Re: large info structure?
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: large info structure? [message #56112 is a reply to message #56111] Tue, 02 October 2007 14:08 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> markb77@gmail.com writes:
>
>> I see many examples of widget event handlers that identify the widget
>> generating the event by checking its UVALUE. It seems redundant to
>> store a name in both the UVALUE and the UNAME of each widget. Is
>> there any disadvantage to using a statement like this:
>>
>> widget = widget_info(event.id, /UNAME)
>>
>> to get the source of the event?
>
> The only disadvantage I see is that there are considerably more
> opportunities to screw up string comparisons in CASE
> statements and the like then there are with numbers. But
> if you are careful and ALWAYS stick to a particular case
> for the names, etc. you should be able to cope.

Do you mean a particular case for the the uname/uvalue names, or the case comparison
expression (and the like)? It's almost purely a matter of style, but I prefer the latter, e.g.

string = 'ThIsCaSe' ; case irrelevant...whatever looks nice :o)

CASE STRUPCASE(string) OF
'THISCASE':....
'THATCASE':....
ELSE:...
ENDCASE

I guess one could argue it's self-documenting and localises any confusion over the
convention chosen, but, eh <shrug>.

Anyway...

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: envi_setup_head for TIFF
Next Topic: What is the main difference between a script and a procedure?

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

Current Time: Wed Oct 08 19:59:48 PDT 2025

Total time taken to generate the page: 0.00385 seconds