Dim myPort&
CALL GETWMGRPORT(myPort&)
CALL SETPORT(myPort&)
And away you go.
Don't forget to save and restore any global settings you modify. If you don't, bad things will happen. Your menus will acquire strange sizes, your windows will start to look odd...
If you want a color grafport, use:
CALL GETCWMGRPORT(myPort&)