Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 11, 2016 14:05:08 GMT -5
The issue has been fixed You can download the latest build (2.2.36) from the website: www.second-dimension.com/sbasic/Also, one thing I should mention - the Call function is for asm functions and doesn't act like a typical BASIC "Call" to call user defined sub routines. If you have a sub with arguments, you'd just call it like you would a normal command (without the parenthesis). For example: TryMe 1,2,3,4
Declare Sub TryMe(a as integer, b as integer, c as integer, d as integer) result = a*b*c*d print result End Sub
If the Call command and the use of parenthesis is important, I can add it back in for the next major release, but I rarely see it used at all these days since it's a left over artifact when BASIC required the line to start with a keyword (like the Let keyword).
|
|
|
Post by nathan999 on Jul 12, 2016 3:07:34 GMT -5
Nah, it's not needed. I never use it, but for some reason I did in the example. Don't ask XD
Call was supported in good ol' QB but nobody ever used it. It comes from the time of the first procedure (Sub) support back in v2 and 3. That's mid eighties. Too old. I say ditch it! ;-)
Thanks, I will try it ASAP.
|
|
|
Post by nathan999 on Jul 12, 2016 3:36:01 GMT -5
Minor stuff I've noticed:
- The compiler doesn't like spaces before parentheses in both arrays and function calls, but sometimes the error given is somewhat obscure. For example, if you define a global array and add a space before the parentheses:
Global myArray (7) As Integer
and then use it inside a Sub:
Declare Sub mySub() myArray(2) = 8 End Sub
The error reported is placed at the "myArray(2) = 8" line and reads "Arrays must be pre-dimensionalized". If you decide not to allow whitespace before the parentheses, the error should be thrown on the declaration. Personally, I'd rather let the coder decide how to organize whitespace, but of course that's up to you.
- The same error is reported when the space is placed while accesing the defined array (note the whitespace):
Global a(10) As Integer
Sub MySub() a (2) = b End Sub
reports "Arrays must be pre-dimensionalized" in the "a (2) = b" line.
- Option NOLOADFONT is not recognized. BEX loaded the patterns for a basic font, and that could be avoided using this directive. What's the behaviour in Second BASIC?
And now a serious one, methinks: CONSTs are not visible from within SUBs or FUNCTIONs. Simple test case:
Const #HELLO = 2
Declare Sub a() Print #HELLO End Sub
Compiler complains about constant not defined on the PRINT line.
Thanks, keep up the good work!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 12, 2016 6:09:55 GMT -5
NoLoadFont in BEX just prevents the font from being loaded into vram and doesn't actually remove the font from the rom data. I actually want to fix this as if you're using NoLoadFont, you're most likely using your own font. The white spaces will throw an exception in most modern languages (Visual Basic/Visual Studios will auto correct white spaces, so this isn't generally an issue), but adding autocorrect features will bloat the software (it's already much larger than I'd like it to be). So, it'll stay as is (it should throw an error for both instances, though, and the array not defined is a correct error if there's a space in the declaration and not in the variable reference later on). As for the constants - good catch. I thought they were working just fine, but it seems not (could've become broken when I updated the parser to speed it up, will have to double check that). Since that's not entirely breaking the language/compiler, it'll be in with the next major update (as there are workable solutions for the time being).
|
|
|
Post by nathan999 on Jul 12, 2016 6:48:55 GMT -5
That's cool. I usually use lots of whitespace in PHP, C or Java. The BASIC dialects I use (freeBASIC, mainly) seem to allow any amount of whitespace between symbols. But that's not a big deal, as I said. I have the feeling that my game will compile with the next release Thanks again.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 12, 2016 15:41:56 GMT -5
That's cool. I usually use lots of whitespace in PHP, C or Java. The BASIC dialects I use (freeBASIC, mainly) seem to allow any amount of whitespace between symbols. But that's not a big deal, as I said. I have the feeling that my game will compile with the next release Thanks again. What's holding it back from compiling right now? Consts? I'll take a peek in a little bit to see if it's a quick fix I have some BEX projects that will compile without any issues, but don't work appropriately (such as auto loop death at the start of the game). Since these projects are 15,000+ lines of code, I can't easily troubleshoot it and it would take forever lol. The other issues is some of these commands are commands I never use (I don't use Consts often, and I don't use subs or functions often after seeing the ASM code for them - using a gosub is quicker for this platform, and possibly in general, since you're not messing with anything aside from setting a return address for the "Return" command). At the very least, I can also add in the NoLoadFont option in as well.
|
|
|
Post by nathan999 on Jul 12, 2016 15:53:13 GMT -5
Please don't rush, I can wait. Only missing CONSTs appear in the error log right now, but who knows :-D
I am trying to compile my mammoth just to help you finding bugs, as it uses many BEX features. Getting a clean compile of the game (with some required changes, as discussed) would mean the compiler is almost compatible with BEX (one can't cover everything, small stuff will keep popping out). I don't expect the game to work if it compiles, not because of the incompatibilites, but because it relies on some obscure, dirty, nasty tricks to overcome BEX bugs. I will use Second Basic only for my new projects. My game is already finished and compiled in BEX, after all :-) It's currently in production, I mean, it's being put into cartridges.
Thanks for your support. It's most appreciated :-D
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 12, 2016 19:36:15 GMT -5
Hey, the more bugs reported by the users, the better SecondBASIC will get I fixed the Const issue, a few other little tweaks, added NoLoadFont (should work with the current BASIC.LIB file). I can keep updating these bugs as they pop up as I have a nice new feature in the next major update. Also, if you don't mind, we should probably post in the forums on the Second Dimension site for all of the bug related things
|
|
|
Post by nathan999 on Jul 13, 2016 1:24:14 GMT -5
Fair enough. I'll register there. Next report will be there.
|
|
|
Post by nitrofurano1 on Aug 23, 2016 6:52:29 GMT -5
btw, where from can we download SecondBasic? is there any Ubuntu PPA or something like that?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 23, 2016 7:57:09 GMT -5
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 23, 2016 7:58:00 GMT -5
And after looking at that page, it looks like I have some web stuff fix tonight
|
|
|
Post by nitrofurano1 on Aug 23, 2016 9:16:37 GMT -5
Thanks, and yes, i have being using BEX on Wine, but is SecondBasic planned to be extended as multi-platform? And can we use it as command-line-only compiler, without having to use the ide (sorry being blunt, i really hate ide), or is it planned to behave like that anytime soon? (this is crucially important for me, i’m very used to use text editor and terminal only, and compiling via bash scripts (exactly like what i do with Boriel’s ZX-Basic Compiler) might help us to extend SecondBasic to other 68k platforms, like NeoGeo, Sinclair-QL, Atari-ST, Amiga, X68000, arcade machines, etc. )
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 23, 2016 9:30:44 GMT -5
It will eventually be command line compatible, there's no plans on making it multiplatform, and extending it to other consoles is probably not going to happen, sans NES, which will either be nrom only or nrom and a custom mapper.
|
|
|
Post by nitrofurano1 on Aug 23, 2016 9:32:05 GMT -5
btw, i’m now trying SecondBasic, it’s not opening .sbs files
and i can only open .sbs files on hex-editors (like ghex), not text editors... :S (quite weird situation, since i can open .bex files on text editors perfectly fine)
|
|