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

Home » Public Forums » archive » RESIZE_DOIT
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: RESIZE_DOIT [message #93265 is a reply to message #93264] Tue, 24 May 2016 12:58 Go to previous message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Tuesday, May 24, 2016 at 11:30:47 AM UTC-6, Spencer Wahrman wrote:
> Hi all,
>
> I've written some code to batch resize some image data, and I'm getting the following error message:
> Type conversion error: Unable to convert given STRING to Integer.
>
> The loop I've written to resize the data is:
> while (i lt total_frames) do begin
> Swath_size = [-1L,0,480,Start_Line, End_Line]
> ENVI_DOIT, 'RESIZE_DOIT', FID=in_file, DIMS=Swath_size,$
> OUT_NAME=input_file_name + Swath_num, R_FID=in_file, RFACT=Swath_size
> Swath_num = Swath_num + 1
> Start_Line = Start_Line + Num_Scene_Frames + Num_Invalid_Frames
> End_Line = Start_Line + Num_Scene_Frames
> end
>
> I'd appreciate some more sets of eyes to help me see what I'm missing.
>
> Thanks

In this expression
OUT_NAME=input_file_name + Swath_num
the variable "input_file_name" is a string, I presume, while "Swath_num" is an integer. In the IDL language, the "+" operator applied to a number and a string will attempt to cast the string to a number, and not the other way around.

You probably want something like the following instead
OUT_NAME=input_file_name + Swath_num.tostring()
or
OUT_NAME=input_file_name + strtrim(Swath_num, 2)

Jim P
[Message index]
 
Read Message
Read Message
Previous Topic: check whether i'm in the virtual machine
Next Topic: IDL Morph structuring element

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

Current Time: Wed Oct 08 15:49:10 PDT 2025

Total time taken to generate the page: 0.00426 seconds