IDL > print,5*3
15
IDL > y="test"
IDL > print,y
test
IDL > print,5*3," This is a "+y
15 This is a test
/-\ |-|
P--------|B|---B----|S|-----Q
\_/ |_| |
|___!B_________|
If B then SIf name eq 'Your_Name' then begin print,'Hi '+name print,"Go Gators!" endif else begin if name ne '' then print,"Wrong name." else print,"You didn't enter anything" print,"Goodbye." endelse
CASE name OF 'Matt Bonner': print,"senior forward" 'Brett Nelson': print,"senior shooting guard" 'Justin Hamilton': print,"senior point guard" else: print,"this player is not a senior" endcaseThe else clause is optional but must come at the end if included.
____________________
| |
/-\ |-| |
---I---|B|---B----|S|----I-|
\_/ |_|
|
|_____!B______--- >
x=0 for j = 4, 1, -1 do begin x=x+j^2 print,x endfor Results in: 16 25 29 30
x=1 while x lt 10 do begin x=2*x+1 print,"X="+string(x) endwhile Results in: X= 3 X= 7 X= 15
x=1 repeat begin x=2*x+1 print,"X="+string(x) endrep until x ge 10 Does the same thing as the while example above.