From QB64 Wiki
The _SCREENEXISTS function returns a -1 value once a screen has been created.
- screenready = _SCREENEXISTS
- Function returns a true value once a program screen is available to use or change.
- Avoids program errors or omissions because a screen was not ready for input or alterations.
Example: The loop waits until the screen exists to add the title.