PLAY (function): 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
No edit summary |
(Document QB64-PE v3.8.0 changes) |
||
Line 3: | Line 3: | ||
{{PageSyntax}} | {{PageSyntax}} | ||
: {{Parameter| | : {{Parameter|numericExpression&}} = '''PLAY''' ({{Parameter|numericExpression&}}) | ||
{{PageParameters}} | {{PageParameters}} | ||
* {{Parameter|notesLeft&}} is the number of notes left to play in the background music queue. | * {{Parameter|notesLeft&}} is the number of notes left to play in the background music queue. | ||
* {{Parameter| | * {{Parameter|numericExpression&}} can be any numeric expression. This is ignored. | ||
Line 20: | Line 17: | ||
{{PageAvailability}} | {{PageAvailability}} | ||
* '''QB64-PE v3. | <!-- QB64 = a version or none, QBPE = a version or all, Platforms = yes or no --> | ||
<gallery widths="48px" heights="48px" mode="nolines"> | |||
File:Qb64.png|'''no''' | |||
File:Qbpe.png|'''v3.1.0 and up''' | |||
File:Apix.png | |||
File:Win.png|'''yes''' | |||
File:Lnx.png|'''yes''' | |||
File:Osx.png|'''yes''' | |||
</gallery> | |||
<!-- additional availability notes go below here --> | |||
* In QB64, this function always returned zero. | |||
* Unlike QuickBASIC, in QB64-PE this function does not return the number of notes left, but the number of audio samples. | |||
* In '''QB64-PE v3.8.0''' if {{Parameter|numericExpression&}} is a number other than zero, then the function will return the amount of time (seconds) left to play. | |||
Revision as of 10:09, 17 June 2023
The PLAY function returns the number of remaining notes in the background music queue.
Syntax
- numericExpression& = PLAY (numericExpression&)
Parameters
- notesLeft& is the number of notes left to play in the background music queue.
- numericExpression& can be any numeric expression. This is ignored.
Description
- This function may be used to detect, if the background music queue is still playing.
- When there is nothing left to play, then this function returns zero.
Availability
- In QB64, this function always returned zero.
- Unlike QuickBASIC, in QB64-PE this function does not return the number of notes left, but the number of audio samples.
- In QB64-PE v3.8.0 if numericExpression& is a number other than zero, then the function will return the amount of time (seconds) left to play.
Examples
PLAY "mb l4cf.l8el4fag.l8fl4gl8agl4f.l8fl4a>cl2dl4dl4c.<l8al4afg.l8fl4gl8agl4f.l8dl4dcl2f>l4dc.<l8al4afg.l8fl4g>dc.<l8al4a>cl2dl4dc.<l8al4afg.l8fl4gl8agl4f.l8dl4dcl1f" PRINT "Playing tune..." DO playLeft& = PLAY(0) LOCATE , 1: PRINT "Left to play ="; playLeft&; " "; LOOP WHILE playLeft& PRINT: PRINT "And we are done!" END |
See also