Author Topic: Old notes i forgot to share...  (Read 255 times)

0 Members and 1 Guest are viewing this topic.

Brian Alvarez

  • Hero Member
  • *****
  • Posts: 540
    • PluriBASIC
Old notes i forgot to share...
« on: August 24, 2019, 10:25:16 PM »

 Hello Charles, i wrote this when i was working in the dr mario code, i dont recall mucho but i hope it helps
fixing something?...


Code: [Select]
MACRO PlaySFX(n)
    ' Works fine on both (need bycopy, because of byref ASCIIZ).
    SndPlaySound(BYCOPY "sfx" & FORMAT$(n), %SND_RESOURCE OR %SND_ASYNC)

    ' NOTE: This plays in PowerBASIC, no sound in Oxygen.
    'SndPlaySound(("sfx" & format$(n)), %SND_RESOURCE Or %SND_ASYNC)

    ' NOTE: This compiles in PowerBASIC, doesnt compile in Oxygen.
    'SndPlaySound(bycopy ("sfx" & format$(n)), %SND_RESOURCE Or %SND_ASYNC)

END MACRO

 The above code is before converting to Oxygen, but it is kind of the same i think.

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4267
    • Oxygen Basic
Re: Old notes i forgot to share...
« Reply #1 on: August 25, 2019, 04:10:03 AM »
Thanks Brian,

bycopy is not necessary, but it gagged on the following bracket. This will be fixed.

Code: [Select]
function f(char*s)
  print s
end function
'
f ("hello1")
f (("hello2"))
f (bycopy "hello3")
f (bycopy ("hello4")) 'fails