Handle: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "In QB64 '''handles''' are created and used by various statements and functions to reference screen surfaces, images, sounds, fonts and IP users. {{PageSyntax}} ::: '''handle& =''' _NEWIMAGE(800, 600, 32) ::: _FREEIMAGE '''handle&''' ''Usage:'' * SCREEN and image handles in use cannot be freed without error! Change screens or fonts before freeing the handle from memory! * The actual value of the handle is only important if it fails to return a value in the range s...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 19: | Line 19: | ||
* Sound: [[_SNDOPEN]] opens a sound file and [[_SNDCLOSE]] closes the file and releases valid handles above zero from memory. | * Sound: [[_SNDOPEN]] opens a sound file and [[_SNDCLOSE]] closes the file and releases valid handles above zero from memory. | ||
* Fonts: [[_LOADFONT]] loads a font file and [[_FREEFONT]] releases valid handle values above zero from memory. | * Fonts: [[_LOADFONT]] loads a font file and [[_FREEFONT]] releases valid handle values above zero from memory. | ||
* Event: [[_FREETIMER]] finds a free [[TIMER]] event [[INTEGER]] value which is freed by [[TIMER | * Event: [[_FREETIMER]] finds a free [[TIMER]] event [[INTEGER]] value which is freed by [[TIMER|TIMER FREE]]. | ||
* Files: [[FREEFILE]] finds a free file [[INTEGER]] value which is used in [[OPEN]] statements and file functions and is freed by [[CLOSE]] | * Files: [[FREEFILE]] finds a free file [[INTEGER]] value which is used in [[OPEN]] statements and file functions and is freed by [[CLOSE]] | ||
{{PageSeeAlso}} | |||
* [[_SOURCE]], [[_DEST]] | * [[_SOURCE]], [[_DEST]] | ||
{{PageNavigation}} | {{PageNavigation}} |
Latest revision as of 16:56, 24 February 2023
In QB64 handles are created and used by various statements and functions to reference screen surfaces, images, sounds, fonts and IP users.
Syntax
- handle& = _NEWIMAGE(800, 600, 32)
- _FREEIMAGE handle&
Usage:
- SCREEN and image handles in use cannot be freed without error! Change screens or fonts before freeing the handle from memory!
- The actual value of the handle is only important if it fails to return a value in the range specified. A bad return value may create errors!
Handle Functions:
- Image: _NEWIMAGE creates a screen surface, _LOADIMAGE holds a file image and _FREEIMAGE releases valid handles from memory.
- Valid LONG handle returns are less than -1. Failed _LOADIMAGE handle values of -1, zero or positive values are invalid.
- TCP/IP: _OPENHOST, _OPENCLIENT and _OPENCONNECTION open access and CLOSE frees negative handle values from memory.
- Memory: _MEM and _MEMNEW create memory storage areas and _MEMFREE MUST release those areas for other uses.
- Sound: _SNDOPEN opens a sound file and _SNDCLOSE closes the file and releases valid handles above zero from memory.
- Fonts: _LOADFONT loads a font file and _FREEFONT releases valid handle values above zero from memory.
- Event: _FREETIMER finds a free TIMER event INTEGER value which is freed by TIMER FREE.
- Files: FREEFILE finds a free file INTEGER value which is used in OPEN statements and file functions and is freed by CLOSE
See also