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

Home » Public Forums » archive » declare variables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
declare variables [message #45942] Tue, 18 October 2005 12:49
qian is currently offline  qian
Messages: 3
Registered: July 2005
Junior Member
Hi,

I am using FORTRAN and IDL at the same time, so sometime I just assume
some FORTRAN rules when using IDL. I just find out that the variable
type can change within an IDL program, even you declare it to be some
specific type. For example:

data=dblarr(2)

data=[2.3, 3.4]

then now, 'data' is a single precision array.

if I type

data=[2,3]

then it is an integer array.., and data(0)/data(1) = 0 !

I know I should be more careful when programming, always using:

data=[2.3D,4.5D]

But if I read in data from other files, in which '1' actually means
'1.0', is it possible I can re-inforce the array to be certain type (or
let the variables to be certain type throughtout the whole program)? So
even if I type d=1, it is still a real number?

Many thanks,

Qian
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: plotting and colors
Next Topic: Format query

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

Current Time: Wed Oct 08 19:23:24 PDT 2025

Total time taken to generate the page: 0.00483 seconds