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

Home » Public Forums » archive » Re: READS-string conversion problem??!!
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: READS-string conversion problem??!! [message #78549 is a reply to message #78548] Tue, 29 November 2011 05:34 Go to previous message
Kai Muehlbauer is currently offline  Kai Muehlbauer
Messages: 13
Registered: February 2011
Junior Member
Hi,

as far as I see, there might be a chance that your day and year
variables are no strings.

Try something like:

filename =
STRING(year,FORMAT=('I0'))+'_current'+STRING(day,FORMAT=('I0 '))+'.dat'

Please read manual on STRING and FORMAT!

HTH,
Kai


Am 29.11.2011 14:04, schrieb anil:
> Hi,
> This might be a very easy task though, I keep missing something and
> I'm stuck with this type conversion error. My problem is : I have a
> dataset and in the 6th line of these data, there is some information I
> want to use to open other files. What I mean is I will gather month-
> day-year information from this line and by using this I will determine
> the number of that day for that year( julday(x,y,2002)-
> julday(1,1,2002) etc..). And then find the files (another data set in
> the same folder) corresponding to that day. The data set goes like
> 2002_current211.dat,2002_current218.dat etc.. So I just want to write
> something like
> filename=year+'_current'+day+'.dat' which I can not do. Here is the
> code I have:
>
> day3=strmid(b,22,2) ; where b is the 6th line.
> day2=string(day3)
> day1=fix(day2)
> day=intarr(1,1)
> reads,day1,day
>
> I do the same for year and month also
>
> numofday=julday(month,day,year)-julday(1,1,year)
>
> then when I say :
> filename=year+..............
> I always get : % Type conversion error: Unable to convert given STRING
> to Integer. or
> % Type conversion error: Unable to convert given STRING to Long.
>
> What is missing or wrong? Help please
> Regards,
> Anil
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: READS-string conversion problem??!!
Next Topic: IDL Workbench Crashing on Macs

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

Current Time: Fri Oct 10 12:43:36 PDT 2025

Total time taken to generate the page: 1.19900 seconds