'..Display an IFF picture with an information window.

'..get file name
f$ = FileBox$("Select an IFF picture file")
if f$="" then
  MsgBox "No file selected!","Continue"
  STOP
end if

'..open IFF file
iff open #1,f$
if Err <> 0 then 
  MsgBox f$+" is not an IFF file.","Continue" 
  STOP
end if

'..get screen info
x = iff(1,1)
y = iff(1,2)
depth = iff(1,3)
mode = iff(1,4)

'..open screen
screen 1,x,y,depth,mode
if Err = 600 then 
  MsgBox "Unable to open screen.","Continue"
  iff close #1
  STOP
end if

'..display picture
iff read #1,1
if Err <> 0 then 
  MsgBox "Error reading "+f$+".","Continue" 
  screen close 1
  iff close #1
  STOP
end if

'..information window (displays file name in all colors available)
window 1,,(x\2-80,y\2-40)-(x\2+80,y\2+40),32,1
for i=0 to 2^depth-1
  color i
  locate 3
  print "** ";f$;" **"
  sleep for .25
next

'..finished
BEEP

'..mouse click or keypress in window required
while inkey$="" and NOT mouse(0):sleep:wend

'..cleanup
window close 1
screen close 1
iff close #1

END
