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 #6120 is a reply to message #6112] Wed, 24 April 1996 00:00 Go to previous messageGo to previous message
plugge is currently offline  plugge
Messages: 17
Registered: May 1995
Junior Member
In article <moninger-2304960900010001@zirkle.fsl.noaa.gov>, moninger@fsl.noaa.gov (Bill Moninger) writes:
|>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.
|>
|>Is there any way to do this without using loops?
|>
|>If I have to use loops, does anyone have a tip on the fastest way to do so?
|>
|>Is there are better way to configure the array station_name to make such
|>tests (against a particular station name) faster?
|>
|>I shall appreciate any help anyone can provide.
|>
|>-Bill Moninger
|>--
|>Bill Moninger, NOAA/Forecast Systems Laboratory.
|>home: 303-494-1709, work: 303-497-6435
|>

Bill,
you can simply do the logical test `eq' to the two arrays:

eql_array = station_name eq find_this_station

The result is an array eql_array containing 1 or 0 according to the comparison
of the corresponding elements of the two arrays.

------------------------------------------------------------ -------------
Michael Plugge _ Fachhochschule Mannheim
Institute for Statistics / \ Hochschule fuer Technik und Gestaltung
and Image Processing / \ Email: plugge@biv7.sr.fh-mannheim.de
Speyerer Str. 4 / \ Tel: 0621 2926208
68163 Mannheim / \ --o /\
Germany / -- - \<,- / \/\
/ \ (_)/ (_) / \/\
------------------------------------------------------------ -------------
[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: Sat Oct 11 03:57:16 PDT 2025

Total time taken to generate the page: 1.68274 seconds