• Print

Author Topic: ON PLAY, PLAY(n) ON/OFF/STOP  (Read 1264 times)

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4664
  • QB Forever
    • Email
ON PLAY, PLAY(n) ON/OFF/STOP
« on: December 04, 2009, 02:26:51 AM »
No work has been done on this command yet.
Something old... Something new... Something borrowed... Something blue...

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: ON PLAY, PLAY(n) ON/OFF/STOP
« Reply #1 on: November 04, 2010, 03:44:27 PM »
Since PLAY apparently has been implemented, when will it actually DELAY a program and when will events be supported?

We were never told that PLAY worked...

Ted
« Last Edit: November 07, 2010, 05:48:56 AM by Clippy »
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4664
  • QB Forever
    • Email
Re: ON PLAY, PLAY(n) ON/OFF/STOP
« Reply #2 on: November 06, 2010, 06:54:22 AM »
Quote
when will it actually DELAY a program
It already does, in the same way as QBASIC did.

Quote
when will rvrnts be supported?
Events will be implemented sooner or later. :)
Something old... Something new... Something borrowed... Something blue...

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: ON PLAY, PLAY(n) ON/OFF/STOP
« Reply #3 on: November 06, 2010, 07:49:12 AM »
Well, I had to add a delay to this song as it printed everything at once.

Qbasic runs it 2 lines of print at a time :


Code: [Select]
CLS : PRINT "Frosty the Snow Man"
FOR X = 1 TO 2
  PRINT
  IF X = 1 THEN PRINT "Fros-ty the Snow man was a jolly happy soul,"
  IF X = 2 THEN PRINT "Fros-ty the Snow man knew the sun was hot that day"
  PLAY "mb t140o2p4g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g2."
  IF X = 1 THEN PRINT "with a corn cob pipe and a button nose and two eyes made out of coal."
  IF X = 2 THEN PRINT "so he said Let's run and we'll have some fun now before I melt away."
  PLAY "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4f4g2."
  IF X = 1 THEN PRINT "Fros-ty the Snow Man is a fair-y tale, they say,"
  IF X = 2 THEN PRINT "Down to the vil-lage, with a broom-stick in his hand,"
  PLAY "g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g2."
  IF X = 1 THEN PRINT "He was made of snow but the chil-dren knew how he come to life one day."
  IF X = 2 THEN PRINT "run-ning here and there all a-round the square, say-in' catch me if you can."
  PLAY "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4d4c2."
  IF X = 1 THEN PRINT "There must have been some magic in that old silk hat they found."
  IF X = 2 THEN PRINT "He led them down the streets of town right to the traffic cop."
  PLAY "c4a4a4o3c4c4o2b4a4g4e4f4a4g4f4e2."
  IF X = 1 THEN PRINT "For when they placed it on his head he be-gan to dance a round."
  IF X = 2 THEN PRINT "And he on-ly paused a moment when he heard him hol-ler Stop!"
  PLAY "e8e8d4d4g4g4b4b4o3d4d8o2b8o3d4c4o2b4a4g4p4"
  IF X = 1 THEN PRINT "Oh, Fros-ty the Snow Man was a-live as he could be,"
  IF X = 2 THEN PRINT "For, Fros-ty the Snow Man had to hur-ry on his way"
  PLAY "g2g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g8g2."
  IF X = 1 THEN PRINT "and the chil-dren say he could laugh and play just the same as you and me."
  IF X = 2 THEN PRINT "but he waved good-bye say-in' Don't you cry, I'll be back a-gain some day."
  PLAY "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4d4c2.p4"
_DELAY 55  'PLAY in QB64 does not delay program
NEXT X
PRINT : PRINT "Thump-et-y thump thump, thump-et-y thump thump, look at Fros-ty go."
PLAY "t180g8g8g4g4g4a8g8g4g4g4a4g4e4g4d1"
PRINT "Thump-et-y thump thump, thump-et-y thump thump, ov-er the hills of snow."
PLAY "t180g8g8g4g4g4a8g8g4g4g4g8g8g4a4b4o3c2c4p1"
END

Ted
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: ON PLAY, PLAY(n) ON/OFF/STOP
« Reply #4 on: November 25, 2010, 10:10:43 PM »
BTW, what do  the commas do in a PLAY string statement?
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Pete

  • Moderator
  • Hero Member
  • *****
  • Posts: 6240
  • Cuz I sez so varmint!
Re: ON PLAY, PLAY(n) ON/OFF/STOP
« Reply #5 on: November 26, 2010, 02:12:31 AM »

Why they are the backup STRINGERS, of course!  ;D

Pete
It's only rocket science; it's not Linux!

Mega

  • Sr. Member
  • ****
  • Posts: 295
  • Who GNU?
Re: ON PLAY, PLAY(n) ON/OFF/STOP
« Reply #6 on: November 28, 2010, 09:09:53 AM »

Why they are the backup STRINGERS, of course!  ;D

Pete

LoL
Just an old-school programmer of covox speech things and such...

  • Print