compiler error (*solved*) - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: compiler error (*solved*) (/showthread.php?tid=301) |
compiler error (*solved*) - slenkar - 02-15-2011 im using the latest beta build here is my source: Code: BORDER 7 : PAPER 7 : INK 0 : CLS here is the error message when I compile: Quote:Traceback (most recent call last): also it seems that underscores are not allowed in function names, is this right? Re: compiler error - boriel - 02-15-2011 slenkar Wrote:im using the latest beta buildOk. Regardless your code, this is a compiler error. Thanks! :wink: Will fix it as soon as possible :!: slenkar Wrote:also it seems that underscores are not allowed in function names, is this right?Not yet (the assembler does, though). I'm thinking to allow them. What do you think? (other people has asked for it). It's a bit hard, because I used the "_" character as a namespace mangler. If the user declares "__PRINT", it can collide with the __PRINT subroutine in the /library-asm/ directory, and so on. Re: compiler error - slenkar - 02-15-2011 I like underscores if its possible I would like them , but if its too difficult I could go without. Could you use any of these symbols as a name space mangler ? - ? | Im glad you put functions in zxbasic and removed the need for line numbers Re: compiler error - boriel - 02-15-2011 slenkar Wrote:I like underscores if its possible I would like them , but if its too difficult I could go without.Unfortunately not. In fact, the assembler allows ".". Thus this.identifier.is.a.valid.one is a valid identifier, and you can type: Code: asm slenkar Wrote:Im glad you put functions in zxbasic and removed the need for line numbersThere are some libraries already done. Look in /library/. Just include them with #include <....bas> (use agle brackets for standard libraries, instead of quotes). When using compiler optimization >= 1 (-O1, -O2, -O3...) unused functions won't be compiled to save memory. This will issue a warning you can safely ignore. Allowing multiline sentences is what makes impossible to allow "single lined" IFs like in the original ZX BASIC, so every IF must be closed with its corresponding END IF. READ, DATA & RESTORE not only are affected by this. They're really tricky. Re: compiler error - boriel - 02-17-2011 slenkar Wrote:here is the error message when I compile:Okay, this bug seems to be fixed. Can you download v1.2.7-r2075 from the download page and test it, please?? :roll: Also, remember INCBIN is not a preprocessor directive, but an assembler one (so no preceding # -sharp- character). Re: compiler error - slenkar - 02-17-2011 works perfectly now, thanks :o do you have a list of arguments that 'print' accepts? the wiki page for 'print' hasnt been done yet check out my game! <!-- m --><a class="postlink" href="http://www.mediafire.com/?71xtf8habqbcgdy">http://www.mediafire.com/?71xtf8habqbcgdy</a><!-- m --> Re: compiler error - boriel - 02-17-2011 slenkar Wrote:works perfectly now, thanks :oOk, if you happen to use ZX Spectrum BASIC, PRINT works exactly as original PRINT except it's a different faster routine (not the one in the ROM, which is slower). It accepts AT, INK, PAPER, INVERSE, FLASH, BRIGHT, and OVER. Note INK 8 and PAPER 8 also work as expected. And unlike in ZX Basic, everything also affects PLOT,DRAW & CIRCLE routines. OVER is extended as follows:
TAB and , (the COMMA) work as in the original PRINT. The End Of Line character (') must be replaced with CHR$(13), because ZX Basic uses ' as an alias of REM Also there are BOLD and ITALIC. Try: Code: PRINT BOLD 1; "HELLO "; BOLD 0; ITALIC 1; "WORLD" slenkar Wrote:check out my game!I tried, but when clicked a download, it shows an HTTP error??? Try uploading in this post? Can you? (I can give you permission if not). Update:Ok, just downloaded! (not sure what happened before!). Hey! This looks promising! :-) Re: compiler error (*solved*) - boriel - 02-17-2011 Okay, I've updated the compiler (go to download page, please), to ver 1.2.7-r2077. This version adds compatibility with Sinclair BASIC BIN syntax. So BIN 0101010, for example, should be allowed now. Can you check it? :roll: Re: compiler error (*solved*) - slenkar - 02-18-2011 thanks ill have to experiment with the OVER functions.. |