+Random Terrain Posted October 24, 2009 Share Posted October 24, 2009 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 Quote Link to comment Share on other sites More sharing options...
+batari Posted October 24, 2009 Share Posted October 24, 2009 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 A semicolon should work for comments in data statements, player definitions, and maybe a few other things. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted October 24, 2009 Author Share Posted October 24, 2009 A semicolon should work for comments in data statements, player definitions, and maybe a few other things. Is there a special way you need to use it? I can't make it work so far. Quote Link to comment Share on other sites More sharing options...
accousticguitar Posted October 24, 2009 Share Posted October 24, 2009 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 A semicolon should work for comments in data statements, player definitions, and maybe a few other things. Did you try changing those colons to semicolons? (I assume you don't need the colons in there.) 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 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted October 24, 2009 Author Share Posted October 24, 2009 Did you try changing those colons to semicolons? (I assume you don't need the colons in there.) Yeah, that's what I did, except with a working example program. If a semicolon works, there must be a certain way you're supposed to use it that I'm not doing. Quote Link to comment Share on other sites More sharing options...
+batari Posted October 24, 2009 Share Posted October 24, 2009 It works in data statements, but apparently not sdata statements. Strange. Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 24, 2009 Share Posted October 24, 2009 (edited) [edit] nevermind... I see that it was sdata causing problems, not data [/edit] Edited October 24, 2009 by RevEng Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted October 24, 2009 Author Share Posted October 24, 2009 It works in data statements, but apparently not sdata statements. Strange. We'll, that sucks. Thanks for checking. Maybe you can fix that in an upcoming version of bB. It would be very helpful to have the ability to add comments because I get lost. 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. Quote Link to comment Share on other sites More sharing options...
+batari Posted October 24, 2009 Share Posted October 24, 2009 It works in data statements, but apparently not sdata statements. Strange. We'll, that sucks. Thanks for checking. Maybe you can fix that in an upcoming version of bB. It would be very helpful to have the ability to add comments because I get lost. 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. I see the problem. I have fixed the code, so whenever we make another release, this will be a part of it. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted October 24, 2009 Author Share Posted October 24, 2009 I see the problem. I have fixed the code, so whenever we make another release, this will be a part of it. Thanks! Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted October 24, 2009 Share Posted October 24, 2009 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 A semicolon should work for comments in data statements, player definitions, and maybe a few other things. 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. Michael Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted October 24, 2009 Author Share Posted October 24, 2009 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. Just tried it in a dim and there are weird scrunched graphics near the top and there is a funny beeping noise. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted October 24, 2009 Share Posted October 24, 2009 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. Just tried it in a dim and there are weird scrunched graphics near the top and there is a funny beeping noise. 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 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted October 24, 2009 Author Share Posted October 24, 2009 I'm guessing this might be something batari could fix in the compiler. It sure would be nice to have comments right next to DIMs. Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 24, 2009 Share Posted October 24, 2009 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. Quote Link to comment Share on other sites More sharing options...
+batari Posted October 24, 2009 Share Posted October 24, 2009 (edited) 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 think the solution would be to allow for ; comments anywhere and /* */ multiline comments. 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 October 24, 2009 by batari Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 24, 2009 Share Posted October 24, 2009 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. 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? 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.