SCREENEXISTS: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:_SCREENEXISTS}} The _SCREENEXISTS function returns true (-1) once a screen has been created. {{PageSyntax}} : {{Parameter|screenReady%%}} = _SCREENEXISTS {{PageDescription}} * 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. ** Use before _TITLE, _SCREENMOVE and other functions that require the output window to h...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:


{{PageExamples}}
{{PageExamples}}
''Example:'' The loop waits until the screen exists to add the title.
;Example:Waiting in a loop until the screen exists to add the title. The [[_LIMIT]] prevents the loop from using all CPU time while waiting.
{{CodeStart}} '' ''
{{CodeStart}}
{{Cl|SCREEN}} 12
{{Cl|SCREEN}} 12
{{Cl|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} _{{Cl|SCREENEXISTS}}
{{Cl|DO}}: {{Cl|_LIMIT}} 10: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|_SCREENEXISTS}}
{{Cl|_TITLE}} "My Title"
{{Cl|_TITLE}} "My Title"
{{CodeEnd}}
{{CodeEnd}}

Latest revision as of 17:29, 25 November 2022

The _SCREENEXISTS function returns true (-1) once a screen has been created.


Syntax

screenReady%% = _SCREENEXISTS


Description

  • 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.
    • Use before _TITLE, _SCREENMOVE and other functions that require the output window to have been created.


Examples

Example
Waiting in a loop until the screen exists to add the title. The _LIMIT prevents the loop from using all CPU time while waiting.
SCREEN 12
DO: _LIMIT 10: LOOP UNTIL _SCREENEXISTS
_TITLE "My Title"


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link