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

Home » Public Forums » archive » Orthorectifying Quickbird scenes with RPC files
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: OR [message #70728 is a reply to message #67037] Mon, 03 May 2010 16:06 Go to previous messageGo to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
On 03/05/2010 5:55 PM, fgg wrote:
> Hello there,
>
> How can I summarize these two lines in just one line of code?
>
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne 4002) then message,
> $
> 'The # of samples per shot is not valid.'
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne 10882) then message,
> $
> 'The # of samples per shot is not valid.'
>
> ...I thought using OR would do the trick, but I guess I'm missing
> something here:
>
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne (4002 or 10882))
> then message, ...
>
> Thanks

Don't you want to use "and" here (on top of what Mike Galloy said to
have the "or" working)?
If n_elements(line) IS 4002, the the other condition (10882) will be
caught!... in other words, you will always have your error message.
a = 8
if (a ne 1 or a ne 8) then print, "error" ===>error
if (a ne 1 and a ne 8) then print ,"error" ===> nothing.

a=100
if (a ne 1 or a ne 8) then print, "error" ===>error
if (a ne 1 and a ne 8) then print ,"error" ===> error.

Jean
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Evaluate a string as a variable name
Next Topic: pointer to object confusion (C++ programmer, IDL n00b)

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

Current Time: Fri Oct 10 11:43:20 PDT 2025

Total time taken to generate the page: 1.28485 seconds