Oxygen Basic

Programming => Bugs & Feature Requests => Topic started by: Brian Alvarez on August 24, 2019, 10:25:16 PM

Title: Old notes i forgot to share...
Post by: Brian Alvarez 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.
Title: Re: Old notes i forgot to share...
Post by: Charles Pegge 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