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

Home » Public Forums » archive » Re: Removing CRLF from a String
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: Removing CRLF from a String [message #11363 is a reply to message #11344] Fri, 20 March 1998 00:00 Go to previous message
David Burridge is currently offline  David Burridge
Messages: 33
Registered: January 1998
Member
Jeff,

Are you sure that it's the CR that is the problem? From your example I
don't.

I see this message a lot when I'm testing a variable that has been
extracted from an array or that comes from a routine that can return
arrays. It normally means that you've got an 1 element array of strings, as
opposed to just a string (doing a help on "filename" and "directoryname"
confirms this).

To cure the problem, use REFORM to remove dimensions of 1 from the array:
filename = REFORM (filename)

BTW: To get IDL to crash (and help with your debugging), type XMANAGER,
CATCH=0 at the prompt. Don't forget to RETALL and XMANAGER after a crash,
though - just like you used to IDL 4!

Cheers,

Dave

Jeff <jeffe@fl.ensco.com> wrote in article
<351154EA.A6AD4CD5@fl.ensco.com>...
> IDL was outputting the following message to me:
>
> % XMANAGER: Caught unexpected error from client application. Message
> follows...
> % MESSAGE: Expression must be a scalar in this context: <STRING
> Array[1]>.
>
> After tracking down what it really meant, I found that the fileName
> I was passing to the READ_ASCII routine had a CR at the end of it.
> (Boy I wish it returned a line number or Procedure where it bombed)
>
> I am using the CW_FIELD to get the string, so I do I avoid getting
> the CR, or how do I remove it.
>
> I've tried STRTRIM but it leaves CR's.
> I've tried using a WIDGET_TEXT rather than a CW_FIELD but get the
> same results.
>
> My simple example program is attached.
>
> Thanks,
>
> Jeff
[Message index]
 
Read Message
Read Message
Previous Topic: bug in program going from pc to sun
Next Topic: Re: another call_external newbie

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

Current Time: Sat Oct 11 07:49:32 PDT 2025

Total time taken to generate the page: 1.84154 seconds