From QB64.org wiki
The _SCREENEXISTS function returns true (-1) once a screen has been created.
- screenReady%% = _SCREENEXISTS
- Function returns true (-1) once a program screen is available to use or change.
- Can be used to avoid program errors because a screen was not ready for input or alterations.
Example: The loop waits until the screen exists to add the title.