I had an issue with my Boriel that prevented me from using the debugger. This has been fixed with help from the forum and me installing the latest version of the Boriel ZXBasicStudio.
My issue now is that I can no longer see Key Words when entering code (see attachment). If anyone could help on this it would be highly appreciated.
I checked with the older version and that does show the KeyWords, but won't run in debug mode.
I am working my way through the book 'Boriel Basic for Beginners'. It is a very good book and well written. I have convinced my friend to buy a copy too.
On page 166 in the example the first command is '#INCLUDE "ship.gdu.bas". When I exported the UDG's as per the instructions on page 165 it creates a file 'ship.gdu.zxbas'
I was wondering why it did not export with the extension '.bas'. I understand I just need to change the extension in the code and it loads in fine, I just want to understand why. It may be something I have done wrong.
I'm using print64.bas, and the code I'm using to show a command menu is as follows:
Code:
const COLOR_BLACK as ubyte = 0
const COLOR_BLUE as ubyte = 1
const COLOR_RED as ubyte = 2
const COLOR_MAGENTA as ubyte = 3
const COLOR_GREEN as ubyte = 4
const COLOR_CYAN as ubyte = 5
const COLOR_YELLOW as ubyte = 6
const COLOR_WHITE as ubyte = 7
sub cursor_to(row as ubyte, col as ubyte)
printat64( row, col )
end sub
sub cprint(s as string)
print64( s )
end sub
sub lf()
cprint( CR )
end sub
sub set_colors(i as ubyte, p as ubyte)
paper( p )
ink( i )
end sub
sub set_default_colors()
set_colors( COLOR_WHITE, COLOR_BLACK )
end sub
sub set_highlighted_colors()
set_colors( COLOR_CYAN, COLOR_BLACK )
end sub
sub set_action_colors()
set_colors( COLOR_YELLOW, COLOR_BLACK )
end sub
sub print_word_marked_initial(word as string)
set_action_colors()
cprint( word( 0 ) )
set_default_colors()
cprint( word( 1 to ) )
end sub
sub print_cmds()
' Print basic options
cursor_to( SCR_FIRST_LINE_CMDS, 0 )
print_word_marked_initial( "Inv " )
print_word_marked_initial( "Mira alrededor " )
cprint( "E" ): print_word_marked_initial( "xamina... " )
print_word_marked_initial( "Norte " )
print_word_marked_initial( "Sur " )
print_word_marked_initial( "Este " )
print_word_marked_initial( "Oeste " )
print_word_marked_initial( "Arriba " )
cprint( "A" )
print_word_marked_initial( "bajo" )
lf()
' Print object manipulation options
print_word_marked_initial( "Coge... " )
print_word_marked_initial( "Deja... " )
cprint( "Em" ): print_word_marked_initial( "puja... " )
print_word_marked_initial( "Tira de... " )
print_word_marked_initial( "Rompe... " )
end sub
Well, the code should be straightforward. I also know it should work because I ported it from C, the same source code I used wtith z88dk. Unfortunately, it does not work, or it does not always work... (check the image).
if x1 = 3 (or any positive number) the correct result (9) is printed.
If x1 = -3 I get no result in the output (nothing is printed on the screen) and no message is shown.
I've tried to define x1 and x2 as integer, with the same problem.
I'm using 1.17.3 version with ZX Basic Studio, but I also tried with Visual Studio Code and Fuse (same result).
I'm doing something wrong or it's a bug?
Thanks
After doing some more changes to my project, zxbc started to complain about "Can't convert non-numeric value to string at compile time", check it out:
Code:
reveni.bas:46: error: Can't convert non-numeric value to string at compile time
reveni.bas:44: error: Can't convert non-numeric value to string at compile time
The second error is signaling a line that... is empty! The first error refers to the following source:
Code:
clrscr()
I think this means that the compiler gets somehow confused about something. I'm attaching the project.
Thanks,
-- Baltasar