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

Home » Public Forums » archive » Re: quick testing of string variables
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: quick testing of string variables [message #6113 is a reply to message #6112] Wed, 24 April 1996 00:00 Go to previous messageGo to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
moninger@fsl.noaa.gov (Bill Moninger) wrote:
>
> I have an array called station_name, dimensioned (6,n). Each item is a
> string 6 characters long. I would like to quickly test station_name
> against a particular string variable, find_this_station, another string of
> dimension 6.
>

I don't quite get from your message the dimensions of your
second string variable. Is it of LENGTH 6?

When you need to compare a STRARR(N) against a single string (or more
generally any array against a scalar) use the WHERE function:

indices = WHERE( station_name eq find_this_station )

Read the online help on the WHERE() function...it's extremely useful.

Also useful are UNIQ(), TOTAL(), SORT(), REFORM(), REVERSE()
and SHIFT().

Dave Foster
foster@bial1.ucsd.edu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL CGM driver
Next Topic: High color on window95

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

Current Time: Fri Oct 10 18:18:00 PDT 2025

Total time taken to generate the page: 0.39829 seconds