O.k. got me there ....
a) use a scanf, this will put the prog to an halt till
you hit return in the shell-window.
b) put a delay(200) between CloseScreen and CloseLibrary()
to see where the problem lies. Closing a screen may be
delayed to the next vertical blank, enough time for your
code to hit that suspicious CloseLibrary().
c) remove CloseLibrary, and if that helps also remove OpenLibrary
and put extern in front of the IntuitioBase-definition.
Bout text on Screens:
There is IntuiText() for that, but you shouldn't use that
directly on a screen, but open a window (backdrop-wins are
praticly invisible), and it would be off little use since
we want to know what happens when you close that screen.
It would also be nice if you could tell us what compiler you
use and with which options.