sdata musicData=x 0,0,0 0,0,0 1 0,0,0 : rem test 01 0,0,0 : rem test 02 1 0,0,0 0,0,0 1 255,255,255 255,255,255 1 end
Any way to put REM in DATA?
Started by Random Terrain, Oct 23 2009 11:37 PM
16 replies to this topic
#1 ONLINE
Posted Fri Oct 23, 2009 11:37 PM
Is there any way to put remarks next to data? Here's an example that doesn't work:
#2
Posted Fri Oct 23, 2009 11:56 PM
Random Terrain, on Fri Oct 23, 2009 11:37 PM, said:
Is there any way to put remarks next to data? Here's an example that doesn't work:
sdata musicData=x 0,0,0 0,0,0 1 0,0,0 : rem test 01 0,0,0 : rem test 02 1 0,0,0 0,0,0 1 255,255,255 255,255,255 1 end
#3 ONLINE
#4
Posted Sat Oct 24, 2009 12:25 AM
batari, on Fri Oct 23, 2009 11:56 PM, said:
Random Terrain, on Fri Oct 23, 2009 11:37 PM, said:
Is there any way to put remarks next to data? Here's an example that doesn't work:
sdata musicData=x 0,0,0 0,0,0 1 0,0,0 : rem test 01 0,0,0 : rem test 02 1 0,0,0 0,0,0 1 255,255,255 255,255,255 1 end
sdata musicData=x 0,0,0 0,0,0 1 0,0,0 ; rem test 01 0,0,0 ; rem test 02 1 0,0,0 0,0,0 1 255,255,255 255,255,255 1 end
#5 ONLINE
Posted Sat Oct 24, 2009 12:47 AM
accousticguitar, on Sat Oct 24, 2009 12:25 AM, said:
Did you try changing those colons to semicolons? (I assume you don't need the colons in there.)
#6
Posted Sat Oct 24, 2009 1:07 AM
It works in data statements, but apparently not sdata statements. Strange.
#7
Posted Sat Oct 24, 2009 1:09 AM
[edit] nevermind... I see that it was sdata causing problems, not data [/edit]
Edited by RevEng, Sat Oct 24, 2009 1:10 AM.
#8 ONLINE
Posted Sat Oct 24, 2009 7:55 AM
batari, on Sat Oct 24, 2009 1:07 AM, said:
It works in data statements, but apparently not sdata statements. Strange.
Until then, I'll see if I can switch back to regular data.
I just tried regular data and I see that we only need a semicolon before our comments. There's no need for REM. That's good.
#9
Posted Sat Oct 24, 2009 9:53 AM
Random Terrain, on Sat Oct 24, 2009 7:55 AM, said:
batari, on Sat Oct 24, 2009 1:07 AM, said:
It works in data statements, but apparently not sdata statements. Strange.
Until then, I'll see if I can switch back to regular data.
I just tried regular data and I see that we only need a semicolon before our comments. There's no need for REM. That's good.
#10 ONLINE
#11
Posted Sat Oct 24, 2009 2:13 PM
batari, on Fri Oct 23, 2009 11:56 PM, said:
Random Terrain, on Fri Oct 23, 2009 11:37 PM, said:
Is there any way to put remarks next to data? Here's an example that doesn't work:
sdata musicData=x 0,0,0 0,0,0 1 0,0,0 : rem test 01 0,0,0 : rem test 02 1 0,0,0 0,0,0 1 255,255,255 255,255,255 1 end
Michael
#12 ONLINE
Posted Sat Oct 24, 2009 2:30 PM
SeaGtGruff, on Sat Oct 24, 2009 2:13 PM, said:
This works for dim and def statements, too. That's good to know, because I've occasionally wanted to add a comment after a dim statement.
#13
Posted Sat Oct 24, 2009 2:56 PM
Random Terrain, on Sat Oct 24, 2009 2:30 PM, said:
D'oh! You're right, it doesn't work. Sorry for the incorrect announcement. I had just added the code and compiled to see if I got any compile errors. Since I didn't, I assumed it worked. When I just tried to run it, it obviously *doesn't* work. I just looked at the code, and it's weird-- the compiler appears to stop processing the bB source code as soon as it hits a semicolon in a dim or def statement. I'm guessing this might be something batari could fix in the compiler.
Michael
#14 ONLINE
#15
Posted Sat Oct 24, 2009 3:32 PM
I hacked my own preprocess.lex to allow for C++ style // comments. They can go in after a statement (dim or otherwise) or on their own line. In the assembly source they get thrown into the next line, which I think is a not too bad a compromise.
I'd love to see this, and C style /* */ multi-line comments be integrated into the official bB. The later is *way* handy for disabling large blocks of code when you're tracking down a bug.
I'd love to see this, and C style /* */ multi-line comments be integrated into the official bB. The later is *way* handy for disabling large blocks of code when you're tracking down a bug.
#16
Posted Sat Oct 24, 2009 3:37 PM
RevEng, on Sat Oct 24, 2009 3:32 PM, said:
I hacked my own preprocess.lex to allow for C++ style // comments. They can go in after a statement (dim or otherwise) or on their own line. In the assembly source they get thrown into the next line, which I think is a not too bad a compromise.
I'd love to see this, and C style /* */ multi-line comments be integrated into the official bB. The later is *way* handy for disabling large blocks of code when you're tracking down a bug.
I'd love to see this, and C style /* */ multi-line comments be integrated into the official bB. The later is *way* handy for disabling large blocks of code when you're tracking down a bug.
Just a warning that // is a valid bB operator - it is for division with remainder/modulus returned in temp1.
As for comments in dim or sdata, bB should stop at the preprocessor and return an error. Maybe VbB is not configured to capture preprocessor errors?
Edited by batari, Sat Oct 24, 2009 3:39 PM.
#17
Posted Sat Oct 24, 2009 3:52 PM
Ah, didn't realize that // was used for the remainder. I guess I haven't had a need for it yet!
; and /* */ comments in bB would be perfect.
I don't use vbB. I use cygwin and a makefile.
My hack of the preprocessor changes everything after the // into a REM on the next line...
[ \t^]*"//".* {printf("\n rem %s",yytext);}
Ugly, but it works for dim and pretty much everything else, but not within data/sdata statements.
; and /* */ comments in bB would be perfect.
batari, on Sat Oct 24, 2009 3:37 PM, said:
As for comments in dim or sdata, bB should stop at the preprocessor and return an error. Maybe VbB is not configured to capture preprocessor errors?
My hack of the preprocessor changes everything after the // into a REM on the next line...
[ \t^]*"//".* {printf("\n rem %s",yytext);}
Ugly, but it works for dim and pretty much everything else, but not within data/sdata statements.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














