-
Open the IDL development environment. If you are using a Unix X-Windows
system, type IDLDE at the command prompt. If you are using another platform,
start IDL as described for that system.
-
The IDL procedure help
will be used to display information about IDL variables and the IDL environment.
If you want to know the type and value of a variable, A, you can type the
statement
IDL> help,A
Type the following lines at the IDL command prompt
(IDL>):
k=5
help,k
What information is available?
-
We will now construct variables of various types.
These will be used in a later step to construct expressions. Type each
of the commands at the IDL command prompt.
a=3.5
b=12L
c=34B
d='25'X
e='25'O
f=25
Find the data type of each variable by using the
help statement.
Information about octal and hexadecimal constants is given at this link
as well as in the IDL help pages on constants. You should be able to explain
why d, e and f have different integer values.
-
Type the following commands at the IDL command prompt.
The ampersand & is used to allow multiple statements to be entered
on the same line. IDL treats & as a separator between statements. You
should be able to explain both the numerical result and the data type for
each statement.
u=3*k+4 & help,u
v=3*k+4. & help,v
w=b+c & help,w
x=10*c & help,x
y=d+e+f & help,y
z=a*e+b & help,z
-
Type the following commands at the IDL command prompt.
The ampersand & is used to allow multiple statements to be entered
on the same line. IDL treats & as a separator between statements. You
should be able to explain both the numerical result and the data type for
each statement.
p=k/2 & help,p
q=3*k/2 & help,q
r=3*(k/2) & help,r
s=(3+4)/5 & help,s
t=3/5+4/5 & help,t
t2=3/5+4/5. & help,t2
t3=(3+4)/5. & help,t3