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

Home » Public Forums » archive » AND statements
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: AND statements [message #14557 is a reply to message #14504] Tue, 09 March 1999 00:00 Go to previous messageGo to previous message
philaldis is currently offline  philaldis
Messages: 32
Registered: March 1999
Member
Martin Schultz <mgs@io.harvard.edu> wrote:

>> IF NOT (A EQ 0) THEN IF B/A GT 5 THEN <SOMETHING> $
>> ELSE <SOMETHING_ELSE> $
>> ELSE <SOMETHING_ELSE>
>>
>> (Where the second SOMETHING_ELSE is the same as the first one)
>>
>> [...]
>
> in short this is the same as
> IF E1 THEN ( IF E2 THEN A ELSE B ) ELSE C
>
> I don't think there are that many cases where B is really the same as C.

Well I've had it quite often when I've been dealing with pointers and
I want to find out if what a pointer points to is whatever, but ht
epointer might be null. I then obviously have to have a first test for
IF Ptr_Valid(pointer) THEN BEGIN
IF *pointer EQ whatever THEN BEGIN
.
.
.
.
ENDIF ELSE (carry out code for failed pointer)
ENDIF ELSE (carry out code for failed pointer)

The pointer failing due to it not been valid is the same kind of
failing as it not pointing to whatever so I have to either write code
twice or set a flag at (carry..) part and then do
IF flag EQ 1 THEN .... ,

I think that is certainly better than a goto in that circumstance. I
had to use that several times in the ptr_free program I wrote (see
post of 04/03/'99), but then no-one would know about that been as not
one person has loooked at it - oh well I'll leave programs that are of
use to others to the likes of DWF.



Jon Kimber
DERA
ENGLAND
[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: Drag-Drop Possible in IDL5.2 ??
Next Topic: Re: XResources and menu mnemonics

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

Current Time: Fri Oct 10 12:47:35 PDT 2025

Total time taken to generate the page: 1.28741 seconds