Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 335 online users. » 1 Member(s) | 332 Guest(s) Applebot, Bing, Zoran
|
Latest Threads |
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 231
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 268
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,541
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 524
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 423
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 294
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,026
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,867
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 403
|
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,645
|
|
|
Pass an Array to a Sub |
Posted by: XoRRoX - 04-02-2020, 09:30 AM - Forum: ZX Basic Compiler
- Replies (4)
|
 |
Hello all,
I'm pretty new to ZX Basic so please forgive my possible beginner questions.
I'd like to pass an Array to a Sub but cannot seem to figure out how.
Code: dim SortArray(10) as string
SUB SelectionSort (SortArray) 'Compile Error: Syntax Error. Unexpected token 'SortArray' <ARRAY_ID>
{Code}
END sub
'************************ Main ****************************
Let SortArray(0) = "Line 00"
Let SortArray(1) = "Line 02"
Let SortArray(2) = "Line 08"
Let SortArray(3) = "Line 06"
Let SortArray(4) = "Line 01"
Let SortArray(5) = "Line 03"
Let SortArray(6) = "Line 07"
Let SortArray(7) = "Line 04"
Let SortArray(8) = "Line 05"
SelectionSort(SortArray) ' Compile Error: Variable 'SortArray' is an array and cannot be used in this context
Thanks in advance for any insights
|
|
|
Wiki down |
Posted by: LCD - 03-05-2020, 04:13 PM - Forum: How-To & Tutorials
- Replies (2)
|
 |
Hallo Jose. When I try to go to the ZXBC Wiki from your site, it is down. Any chance to bring it up again? I want to finish the help in BorIDE. are there new commands? added? (hint: like SWITCH/CASE)?
|
|
|
Error while compiling little program (*solved*) |
Posted by: maeloterkim - 02-24-2020, 08:15 PM - Forum: Bug Reports
- Replies (2)
|
 |
Hi
This little program should work or am I missing something?
If I compile it gives error
Code: 'Begin program
const A as ubyte = 65
const a as ubyte = 97
print chr$ (A)
print chr$ (a)
'End program
i tried to compile with 1.9.9 version and 1.9.8 version and both have errors while compiling
|
|
|
Bug report with print64 routine |
Posted by: maeloterkim - 02-08-2020, 07:29 PM - Forum: Bug Reports
- Replies (1)
|
 |
Hi
I tried the print64 routine but has a bug
If you try this program in red
#include <print64.bas>
'printat64(10,10) 'This will not work because de poke is incorrect You can try
print64("Hello world!")
print at 15,0;"@p64coords "; @p64coords;
and then you look at the dissasembly attached image
where after the RET with red color in the image, is supposed that is the @p64coords address (when you run the program writes the @p64coords address to check where is)
in this @p64coords address is where is supposed to poke de X and Y values of the new coordinates with the printat64 routine that is included in print64.bas
but the coordinates are in the green lines addresses with the value 12 and 0
you can check this if you look at the same time at the image with colors ( or your own dissasembly) and the print64.bas file
There is some bytes in between that are moving down the useful poke for the coodinates that printat64 routine does
ANOTHER THING
----------------------------------
This bug was found because i was trying to change the print64 font to another one
I did this subroutine for this
' Changes character set of the print64 routine
' this does a poke where is the assembly instruction : ld de, p64_charset
SUB change64Charset (new64CharSet as uinteger)
poke uinteger ( @p64coords - 123 ), new64CharSet
END sub
Maybe you can solve the bug AND at the same time include this subroutine in the print64.bas file
this way the people can change the print64 x,y and the character set of the print64
i named the subroutine change64Charset but you change the name accordly to the print64 routine
i don't know for example print64ChangeCharset or something
you can only must be sure that the poke is always made in the correct positions for both routines
i don't know if is posible to include some constant label inside the routine that makes some positions of memory fixed to be poked
Now we must calculate by hand until fixed someway, where are the addresses to poke
if you try this subroutine adding 7 to the original subroutine it works
SUB newPrintat64 (y as uByte, x as uByte)
POKE @p64coords+7,x
POKE @p64coords+8,y
END sub
|
|
|
Usage of print42? |
Posted by: GusmanB - 02-01-2020, 01:12 PM - Forum: ZX Basic Compiler
- Replies (5)
|
 |
Hi.
I'm trying to use the print42 library but whenever I reference it my program can no longer compile, I get a "Undeclared variable printAt42Coords"
I have found an old thread from 2015 with the same problem which was solved, I have tried the -o0 optimization level but it does not make a difference.
Any idea?
Also, I see the print42 routine includes a "isAt:" label that checks for a char 22, what would be the correct syntax to use it?
Cheers.
|
|
|
|