<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Boriel Basic Forum - Bug Reports]]></title>
		<link>https://forum.boriel.com/</link>
		<description><![CDATA[Boriel Basic Forum - https://forum.boriel.com]]></description>
		<pubDate>Fri, 15 May 2026 14:59:26 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[[SOLVED] Array layout bug - regression in 1.18.3]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2645</link>
			<pubDate>Fri, 24 Oct 2025 22:24:41 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2327">Zoran</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2645</guid>
			<description><![CDATA[Please take a look at this simple programme:<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>dim a(5) as ubyte =&gt; {0, 1, 2, 3, 4, 5}<br />
dim b(5) as ubyte<br />
dim i as uinteger<br />
<br />
for i = 0 to 5<br />
    poke @b + i, a(i)<br />
next<br />
<br />
cls<br />
<br />
for i = 0 to 5<br />
    print a(i), b(i)<br />
next</code></div></div><br />
When compiled with zxbasic 1.18.2 this works as expected - both arrays are same. See the attached image:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=360" target="_blank" title="">arrays_zxbasic_1_18_2.png</a> (Size: 8.81 KB / Downloads: 178)
<!-- end: postbit_attachments_attachment --><br />
However, with zxbasic 1.18.3, the programme fails miserably and crashes the Spectrum<br />
<br />
In both cases compiled with <br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>--optimize 2  --output-format=tzx --BASIC --autorun --explicit --strict</blockquote><br />
Now, this is the simple case made to illustrate the bug. The main problem I have is with character arrays -- I have custom font with cyrilic letters designed in ZXBasicStudio, stored as two dimensional array (95, 7) -- when I want to write cyrilic text I poke <a href="https://skoolkid.github.io/rom/asm/5C36.html" target="_blank" rel="noopener" class="mycode_url">the system variable 5C36</a> to the address of the array minus 256 (@array - &#36;100) and when I want to print latin text, I just poke this variable back to default value  &#36;3C00. This worked perfectly until version 1.18.3 came out. Now, everything is broken, as the characters in the array are obviously not stored continuously in memory.<br />
What happend with array layout?<br />
<br />
<hr class="mycode_hr" />
<br />
<br />
Now I tried to see the address of the array itself, compared with the addresses of array elements:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>dim a(5) as ubyte =&gt; {0, 1, 2, 3, 4, 5}<br />
dim i as uinteger<br />
cls<br />
print "@a = "; @a<br />
print "------------"<br />
for i = 0 to 5<br />
  print "@a("; i; ") = "; @a(i)<br />
next</code></div></div><br />
The attached image shows the output with zxbasic 1.18.2 compared with zxbasic 1.18.3:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=361" target="_blank" title="">arrayAddresses.png</a> (Size: 14.42 KB / Downloads: 208)
<!-- end: postbit_attachments_attachment --><br />
<br />
It seems that in zxbasic 1.18.3, there are eight bytes between the address of the array itself (@a) and the first element (@a(0) ). The array elements are stored continuously after all.<br />
<br />
So, I can workaround the problem with the custom character set that I mentioned in my previous post using:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>poke (uinteger &#36;5c36, @charset(0,0) - &#36;100) ' the address of the first element</code></div></div>instead of<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>poke (uinteger &#36;5c36, @charset - &#36;0100) ' the address of the array</code></div></div><br />
But still, is there a reason for this, or is it just a bug?]]></description>
			<content:encoded><![CDATA[Please take a look at this simple programme:<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>dim a(5) as ubyte =&gt; {0, 1, 2, 3, 4, 5}<br />
dim b(5) as ubyte<br />
dim i as uinteger<br />
<br />
for i = 0 to 5<br />
    poke @b + i, a(i)<br />
next<br />
<br />
cls<br />
<br />
for i = 0 to 5<br />
    print a(i), b(i)<br />
next</code></div></div><br />
When compiled with zxbasic 1.18.2 this works as expected - both arrays are same. See the attached image:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=360" target="_blank" title="">arrays_zxbasic_1_18_2.png</a> (Size: 8.81 KB / Downloads: 178)
<!-- end: postbit_attachments_attachment --><br />
However, with zxbasic 1.18.3, the programme fails miserably and crashes the Spectrum<br />
<br />
In both cases compiled with <br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>--optimize 2  --output-format=tzx --BASIC --autorun --explicit --strict</blockquote><br />
Now, this is the simple case made to illustrate the bug. The main problem I have is with character arrays -- I have custom font with cyrilic letters designed in ZXBasicStudio, stored as two dimensional array (95, 7) -- when I want to write cyrilic text I poke <a href="https://skoolkid.github.io/rom/asm/5C36.html" target="_blank" rel="noopener" class="mycode_url">the system variable 5C36</a> to the address of the array minus 256 (@array - &#36;100) and when I want to print latin text, I just poke this variable back to default value  &#36;3C00. This worked perfectly until version 1.18.3 came out. Now, everything is broken, as the characters in the array are obviously not stored continuously in memory.<br />
What happend with array layout?<br />
<br />
<hr class="mycode_hr" />
<br />
<br />
Now I tried to see the address of the array itself, compared with the addresses of array elements:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>dim a(5) as ubyte =&gt; {0, 1, 2, 3, 4, 5}<br />
dim i as uinteger<br />
cls<br />
print "@a = "; @a<br />
print "------------"<br />
for i = 0 to 5<br />
  print "@a("; i; ") = "; @a(i)<br />
next</code></div></div><br />
The attached image shows the output with zxbasic 1.18.2 compared with zxbasic 1.18.3:<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=361" target="_blank" title="">arrayAddresses.png</a> (Size: 14.42 KB / Downloads: 208)
<!-- end: postbit_attachments_attachment --><br />
<br />
It seems that in zxbasic 1.18.3, there are eight bytes between the address of the array itself (@a) and the first element (@a(0) ). The array elements are stored continuously after all.<br />
<br />
So, I can workaround the problem with the custom character set that I mentioned in my previous post using:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>poke (uinteger &#36;5c36, @charset(0,0) - &#36;100) ' the address of the first element</code></div></div>instead of<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>poke (uinteger &#36;5c36, @charset - &#36;0100) ' the address of the array</code></div></div><br />
But still, is there a reason for this, or is it just a bug?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ZX Basic Studio Bugs]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2638</link>
			<pubDate>Fri, 19 Sep 2025 15:21:36 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2552">ZXPeter</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2638</guid>
			<description><![CDATA[Don't know if this is the correct place for this post  but I'm sure someone will let me know if not.<br />
<br />
This post relates to ZX Basic Studio builds 1.0.8702.19933 2023-10-29 and 1.5.9168.37638 2025-02-06 which ,for brevity, I shall call buildA and buildB respectively.<br />
<br />
Following the instructions for creating a project from pages 47 to 53 of the "Boriel Basic for ZX Spectrum" book I have the following observations:<br />
<br />
(1)<br />
With buildA the Main.bas file appears in the explorer window when it is created,as described in the book. <br />
<br />
With buildB it does not. Closing the displayed code by clicking the X next to the "Main.bas" file name removes the code from view and there is no way of re-opening <br />
it from the explorer window (as it isn't listed there). One way to make the file name visible in the explorer window is to close then re-open the project.<br />
<br />
(2)<br />
For both buildA and buildB running the book's example code (page 51) without debug results in the expected coloured block of X's.<br />
Running the code under debug with a breakpoint set as shown on page 52, neither build produces the full block (stops after 3 and a bit rows).<br />
<br />
Hope this information is useful.]]></description>
			<content:encoded><![CDATA[Don't know if this is the correct place for this post  but I'm sure someone will let me know if not.<br />
<br />
This post relates to ZX Basic Studio builds 1.0.8702.19933 2023-10-29 and 1.5.9168.37638 2025-02-06 which ,for brevity, I shall call buildA and buildB respectively.<br />
<br />
Following the instructions for creating a project from pages 47 to 53 of the "Boriel Basic for ZX Spectrum" book I have the following observations:<br />
<br />
(1)<br />
With buildA the Main.bas file appears in the explorer window when it is created,as described in the book. <br />
<br />
With buildB it does not. Closing the displayed code by clicking the X next to the "Main.bas" file name removes the code from view and there is no way of re-opening <br />
it from the explorer window (as it isn't listed there). One way to make the file name visible in the explorer window is to close then re-open the project.<br />
<br />
(2)<br />
For both buildA and buildB running the book's example code (page 51) without debug results in the expected coloured block of X's.<br />
Running the code under debug with a breakpoint set as shown on page 52, neither build produces the full block (stops after 3 and a bit rows).<br />
<br />
Hope this information is useful.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Strange Happenings]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2625</link>
			<pubDate>Wed, 07 May 2025 09:05:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2220">zedex82</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2625</guid>
			<description><![CDATA[I am not sure if this is just my laptop as I have just done a fresh install of ZXBasic Studio 1.5 and Boriel 1.18.1. <br />
<br />
I have noticed two things.<br />
<br />
1. Any new file I create is not showing in the Project Explorer. I have to reload the project for them to appear<br />
<br />
2. I have left all the colours in the Coding window as default so the main commands are shown in blue. When I type ENDIF it does not change to blue but remains white.<br />
<br />
The laptop I am using is a spare one (windows 10) that I take away with me and I have never installed ZXBasic Studio or Boriel before and I do not have my main laptop to check if it is the laptop or not.<br />
<br />
Thanks<br />
<br />
ZeD]]></description>
			<content:encoded><![CDATA[I am not sure if this is just my laptop as I have just done a fresh install of ZXBasic Studio 1.5 and Boriel 1.18.1. <br />
<br />
I have noticed two things.<br />
<br />
1. Any new file I create is not showing in the Project Explorer. I have to reload the project for them to appear<br />
<br />
2. I have left all the colours in the Coding window as default so the main commands are shown in blue. When I type ENDIF it does not change to blue but remains white.<br />
<br />
The laptop I am using is a spare one (windows 10) that I take away with me and I have never installed ZXBasic Studio or Boriel before and I do not have my main laptop to check if it is the laptop or not.<br />
<br />
Thanks<br />
<br />
ZeD]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Scope rules]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2620</link>
			<pubDate>Thu, 03 Apr 2025 13:54:55 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2327">Zoran</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2620</guid>
			<description><![CDATA[If we have got a routine and another subroutine nested inside the first, the programme behaves unpredictably.<br />
<br />
I wanted to test if the variable declared in outer routine is accessible from the inner routine (I couldn't find it documented anywhere).<br />
<br />
<br />
Please see these two simple examples which show quite different behaviour.<br />
<br />
Both compiled with Zx Basic version 1.17.3, with these options:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>--optimize 2 -f tzx --BASIC --autorun --explicit --strict</blockquote>
<br />
The first example:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#pragma explicit = true<br />
#pragma strict = true<br />
<br />
sub outerRoutine<br />
    dim n as ubyte<br />
    <br />
    sub nestedRoutine()<br />
        print "From inner sub, before: "; n<br />
        n = 22<br />
        print "From inner sub, after: "; n<br />
    end sub<br />
    <br />
    n = 11<br />
    <br />
    print "From outer sub, before: "; n<br />
    nestedRoutine()<br />
    print "From outer sub, after: "; n<br />
end sub<br />
<br />
cls<br />
outerRoutine()</code></div></div><br />
<br />
The output:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>From outer sub, before: 11<br />
From inner sub, before: 11<br />
From inner sub, after: 22<br />
From outer sub, after: 22</blockquote>
<br />
<br />
So the first example shows that variable n, declared in outer routine is fully accessible from the nested routine.<br />
<br />
In the second example, I only added a dummy variable declaration inside the nested routine:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#pragma explicit = true<br />
#pragma strict = true<br />
<br />
sub outerRoutine<br />
    dim n as ubyte<br />
    <br />
    sub nestedRoutine()<br />
        dim k as ubyte ' declare a dummy variable<br />
        if k &lt;&gt; 0 then ' and access it<br />
            print "";  ' do nothing meaningful<br />
        end if<br />
        <br />
        print "From inner sub, before: "; n<br />
        n = 22<br />
        print "From inner sub, after: "; n<br />
    end sub<br />
    <br />
    n = 11<br />
    <br />
    print "From outer sub, before: "; n<br />
    nestedRoutine()<br />
    print "From outer sub, after: "; n<br />
end sub<br />
<br />
cls<br />
outerRoutine()</code></div></div><br />
<blockquote class="mycode_quote"><cite>Quote:</cite>From outer sub, before: 11<br />
From inner sub, before: 0<br />
From inner sub, after: 22<br />
From outer sub, after: 11</blockquote>
<br />
Totally different output!<br />
The main problem is that, referring to variable n, <span style="font-style: italic;" class="mycode_i">something</span> is accessed <span style="font-style: italic;" class="mycode_i">and even written to</span> inside the nested subroutine, but it is clearly not the varible n declared above.<br />
<br />
With explicit and strict options, if the outer routine scope is not accessible, the compiler has to give an error that variable n is not declared in routine innerRoutine.<br />
The compiler gives no error, though. Then the programme behaviour is unpredictable and rather dangerous actually.]]></description>
			<content:encoded><![CDATA[If we have got a routine and another subroutine nested inside the first, the programme behaves unpredictably.<br />
<br />
I wanted to test if the variable declared in outer routine is accessible from the inner routine (I couldn't find it documented anywhere).<br />
<br />
<br />
Please see these two simple examples which show quite different behaviour.<br />
<br />
Both compiled with Zx Basic version 1.17.3, with these options:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>--optimize 2 -f tzx --BASIC --autorun --explicit --strict</blockquote>
<br />
The first example:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#pragma explicit = true<br />
#pragma strict = true<br />
<br />
sub outerRoutine<br />
    dim n as ubyte<br />
    <br />
    sub nestedRoutine()<br />
        print "From inner sub, before: "; n<br />
        n = 22<br />
        print "From inner sub, after: "; n<br />
    end sub<br />
    <br />
    n = 11<br />
    <br />
    print "From outer sub, before: "; n<br />
    nestedRoutine()<br />
    print "From outer sub, after: "; n<br />
end sub<br />
<br />
cls<br />
outerRoutine()</code></div></div><br />
<br />
The output:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>From outer sub, before: 11<br />
From inner sub, before: 11<br />
From inner sub, after: 22<br />
From outer sub, after: 22</blockquote>
<br />
<br />
So the first example shows that variable n, declared in outer routine is fully accessible from the nested routine.<br />
<br />
In the second example, I only added a dummy variable declaration inside the nested routine:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#pragma explicit = true<br />
#pragma strict = true<br />
<br />
sub outerRoutine<br />
    dim n as ubyte<br />
    <br />
    sub nestedRoutine()<br />
        dim k as ubyte ' declare a dummy variable<br />
        if k &lt;&gt; 0 then ' and access it<br />
            print "";  ' do nothing meaningful<br />
        end if<br />
        <br />
        print "From inner sub, before: "; n<br />
        n = 22<br />
        print "From inner sub, after: "; n<br />
    end sub<br />
    <br />
    n = 11<br />
    <br />
    print "From outer sub, before: "; n<br />
    nestedRoutine()<br />
    print "From outer sub, after: "; n<br />
end sub<br />
<br />
cls<br />
outerRoutine()</code></div></div><br />
<blockquote class="mycode_quote"><cite>Quote:</cite>From outer sub, before: 11<br />
From inner sub, before: 0<br />
From inner sub, after: 22<br />
From outer sub, after: 11</blockquote>
<br />
Totally different output!<br />
The main problem is that, referring to variable n, <span style="font-style: italic;" class="mycode_i">something</span> is accessed <span style="font-style: italic;" class="mycode_i">and even written to</span> inside the nested subroutine, but it is clearly not the varible n declared above.<br />
<br />
With explicit and strict options, if the outer routine scope is not accessible, the compiler has to give an error that variable n is not declared in routine innerRoutine.<br />
The compiler gives no error, though. Then the programme behaviour is unpredictable and rather dangerous actually.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Spectrum keywords codes]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2618</link>
			<pubDate>Fri, 07 Mar 2025 20:01:17 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2327">Zoran</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2618</guid>
			<description><![CDATA[Hello,<br />
<br />
The documentation for CHR function (<a href="https://zxbasic.readthedocs.io/en/latest/chr/" target="_blank" rel="noopener" class="mycode_url">https://zxbasic.readthedocs.io/en/latest/chr/</a>) says that, although expanded, the function is 100% Sinclair basic compatible.<br />
If it is so, then for the same parameters I'd expect the same output, not only for ascii letters, but also for sinclair basic keywords.<br />
<br />
In Sinclair basic, this programme:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>10 CLS<br />
20 FOR i = 230 TO 250<br />
30 PRINT CHR&#36; i<br />
40 NEXT i</code></div></div><br />
gives some Basic keywords in the output (see the attached image zxkeywords_sinclair.png).<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=350" target="_blank" title="">zxkeywords_sinclair.png</a> (Size: 10.26 KB / Downloads: 946)
<!-- end: postbit_attachments_attachment --><br />
<br />
The equivalent programme in ZX Basic:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>dim i as ubyte<br />
<br />
cls<br />
for i = 230 to 250<br />
    print chr(i)<br />
next</code></div></div><br />
outputs some silly characters (see the attached image zxkeywords_boriel.png).<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=351" target="_blank" title="">zxkeywords_boriel.png</a> (Size: 11.44 KB / Downloads: 928)
<!-- end: postbit_attachments_attachment --><br />
<br />
Compiled with:<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>..\..\zxbasic\zxbc.exe --optimize 2 --output zxkeywords.tzx --output-format tzx --BASIC --autorun --explicit --strict zxkeywords.bas</blockquote>
<br />
I'd say it is a bug.]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
The documentation for CHR function (<a href="https://zxbasic.readthedocs.io/en/latest/chr/" target="_blank" rel="noopener" class="mycode_url">https://zxbasic.readthedocs.io/en/latest/chr/</a>) says that, although expanded, the function is 100% Sinclair basic compatible.<br />
If it is so, then for the same parameters I'd expect the same output, not only for ascii letters, but also for sinclair basic keywords.<br />
<br />
In Sinclair basic, this programme:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>10 CLS<br />
20 FOR i = 230 TO 250<br />
30 PRINT CHR&#36; i<br />
40 NEXT i</code></div></div><br />
gives some Basic keywords in the output (see the attached image zxkeywords_sinclair.png).<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=350" target="_blank" title="">zxkeywords_sinclair.png</a> (Size: 10.26 KB / Downloads: 946)
<!-- end: postbit_attachments_attachment --><br />
<br />
The equivalent programme in ZX Basic:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>dim i as ubyte<br />
<br />
cls<br />
for i = 230 to 250<br />
    print chr(i)<br />
next</code></div></div><br />
outputs some silly characters (see the attached image zxkeywords_boriel.png).<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=351" target="_blank" title="">zxkeywords_boriel.png</a> (Size: 11.44 KB / Downloads: 928)
<!-- end: postbit_attachments_attachment --><br />
<br />
Compiled with:<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>..\..\zxbasic\zxbc.exe --optimize 2 --output zxkeywords.tzx --output-format tzx --BASIC --autorun --explicit --strict zxkeywords.bas</blockquote>
<br />
I'd say it is a bug.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Using constants not allowed in DATAs]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2615</link>
			<pubDate>Mon, 03 Mar 2025 21:10:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2201">baltasarq</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2615</guid>
			<description><![CDATA[Hi!<br />
Another bug or at least improvement, sorry!<br />
When I create constants, such as:<br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_EOD                            as ubyte = 100</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_LINE                           as ubyte = 101</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_CIRCLE                         as ubyte = 102</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_FILL                           as ubyte = 103</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_UDG                            as ubyte = 104</span><br />
<br />
And then try to use them like so (initializer expression):<br />
<span style="font-family: Courier New;" class="mycode_font">sub draw_presentation()</span><br />
<span style="font-family: Courier New;" class="mycode_font">    dim pic_data(11) as ubyte =&gt; { _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Circle, 50, 180, 10,  _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Fill, 50, 180,        _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Circle, 100, 160, 25, _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_EOD }</span><br />
<span style="font-family: Courier New;" class="mycode_font">    </span><br />
<span style="font-family: Courier New;" class="mycode_font">    draw_pic( pic_data )</span><br />
<span style="font-family: Courier New;" class="mycode_font">end sub</span><br />
<br />
Or maybe like so (DATAs):<br />
<span style="font-family: Courier New;" class="mycode_font">LocPics:</span><br />
<span style="font-family: Courier New;" class="mycode_font">    ' Loc 0 - Limbo</span><br />
<span style="font-family: Courier New;" class="mycode_font">    data DCMD_Line, 0, 180, 250, 100, _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Line, 250, 180, 0, 100, _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_EOD</span><br />
<br />
<span style="font-family: Courier New;" class="mycode_font">    ' Loc 1 - Landing</span><br />
<span style="font-family: Courier New;" class="mycode_font">    data DCMD_Circle, 50, 180, 10,  _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Fill, 50, 180,        _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Circle, 100, 160, 25,  _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_EOD</span><br />
<br />
I receive the following errors:<br />
For the use of constants inside DATAs:<br />
<span style="font-family: Courier New;" class="mycode_font">locs.bas:64: warning: [W100] Using default implicit type 'float' for 'DCMD_Line'</span><br />
<span style="font-family: Courier New;" class="mycode_font">locs.bas:69: warning: [W100] Using default implicit type 'float' for 'DCMD_Circle'</span><br />
<span style="font-family: Courier New;" class="mycode_font">locs.bas:70: warning: [W100] Using default implicit type 'float' for 'DCMD_Fill'</span><br />
<br />
This doesn't make any sense, since they are defined as constants of type <span style="font-style: italic;" class="mycode_i">ubyte</span>.<br />
For the use of these constants inside the constant initializer for an array:<br />
<span style="font-family: Courier New;" class="mycode_font">reveni.bas:14: error: Initializer expression is not constant.</span><br />
<span style="font-family: Courier New;" class="mycode_font">reveni.bas:19: warning: [W100] Using default implicit type 'float' for 'pic_data'</span><br />
<span style="font-family: Courier New;" class="mycode_font">reveni.bas:19: error: Invalid argument 'pic_data'</span><br />
<br />
Again, this doesn't make any sense, since they are constants but the initializer expression is erroneously detected as non-constant.<br />
Could this be solved?<br />
Thanks,]]></description>
			<content:encoded><![CDATA[Hi!<br />
Another bug or at least improvement, sorry!<br />
When I create constants, such as:<br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_EOD                            as ubyte = 100</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_LINE                           as ubyte = 101</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_CIRCLE                         as ubyte = 102</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_FILL                           as ubyte = 103</span><br />
<span style="font-family: Courier New;" class="mycode_font">const DCMD_UDG                            as ubyte = 104</span><br />
<br />
And then try to use them like so (initializer expression):<br />
<span style="font-family: Courier New;" class="mycode_font">sub draw_presentation()</span><br />
<span style="font-family: Courier New;" class="mycode_font">    dim pic_data(11) as ubyte =&gt; { _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Circle, 50, 180, 10,  _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Fill, 50, 180,        _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Circle, 100, 160, 25, _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_EOD }</span><br />
<span style="font-family: Courier New;" class="mycode_font">    </span><br />
<span style="font-family: Courier New;" class="mycode_font">    draw_pic( pic_data )</span><br />
<span style="font-family: Courier New;" class="mycode_font">end sub</span><br />
<br />
Or maybe like so (DATAs):<br />
<span style="font-family: Courier New;" class="mycode_font">LocPics:</span><br />
<span style="font-family: Courier New;" class="mycode_font">    ' Loc 0 - Limbo</span><br />
<span style="font-family: Courier New;" class="mycode_font">    data DCMD_Line, 0, 180, 250, 100, _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Line, 250, 180, 0, 100, _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_EOD</span><br />
<br />
<span style="font-family: Courier New;" class="mycode_font">    ' Loc 1 - Landing</span><br />
<span style="font-family: Courier New;" class="mycode_font">    data DCMD_Circle, 50, 180, 10,  _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Fill, 50, 180,        _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_Circle, 100, 160, 25,  _</span><br />
<span style="font-family: Courier New;" class="mycode_font">        DCMD_EOD</span><br />
<br />
I receive the following errors:<br />
For the use of constants inside DATAs:<br />
<span style="font-family: Courier New;" class="mycode_font">locs.bas:64: warning: [W100] Using default implicit type 'float' for 'DCMD_Line'</span><br />
<span style="font-family: Courier New;" class="mycode_font">locs.bas:69: warning: [W100] Using default implicit type 'float' for 'DCMD_Circle'</span><br />
<span style="font-family: Courier New;" class="mycode_font">locs.bas:70: warning: [W100] Using default implicit type 'float' for 'DCMD_Fill'</span><br />
<br />
This doesn't make any sense, since they are defined as constants of type <span style="font-style: italic;" class="mycode_i">ubyte</span>.<br />
For the use of these constants inside the constant initializer for an array:<br />
<span style="font-family: Courier New;" class="mycode_font">reveni.bas:14: error: Initializer expression is not constant.</span><br />
<span style="font-family: Courier New;" class="mycode_font">reveni.bas:19: warning: [W100] Using default implicit type 'float' for 'pic_data'</span><br />
<span style="font-family: Courier New;" class="mycode_font">reveni.bas:19: error: Invalid argument 'pic_data'</span><br />
<br />
Again, this doesn't make any sense, since they are constants but the initializer expression is erroneously detected as non-constant.<br />
Could this be solved?<br />
Thanks,]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Download links broken]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2613</link>
			<pubDate>Mon, 17 Feb 2025 02:03:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2314">xthunderheartx@gmail.com</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2613</guid>
			<description><![CDATA[Hey I just tried to download (from all the links) and got nothing.  Links look good but boriel.com/files appears to be empty.  Is that right?  It's Sunday night so maybe it's maintenance?<br />
<br />
Thanks - Dallas]]></description>
			<content:encoded><![CDATA[Hey I just tried to download (from all the links) and got nothing.  Links look good but boriel.com/files appears to be empty.  Is that right?  It's Sunday night so maybe it's maintenance?<br />
<br />
Thanks - Dallas]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[2D Array Errors]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2610</link>
			<pubDate>Thu, 13 Feb 2025 15:42:14 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2311">raymondlesley</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2610</guid>
			<description><![CDATA[I've been enjoying using ZX BASIC so far. It's great to have something that's easy to use (and in-keeping with the original Sinclair BASIC). I have come up against an issue which I can't find a solution for:<br />
<br />
The compiler supports multi-dimensional arrays, but it throws an error if I attempt to get a "slice" of the data.<br />
<br />
My code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>DIM data_array(0 TO 2, 0 TO 3) AS UByte = { _<br />
    {0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11} _<br />
}<br />
<br />
DIM element12 AS UByte = data_array(1, 2)<br />
<br />
DIM element0(0 TO 3) AS UByte<br />
<br />
element0 = data_array(0)  ' throws an error</code></div></div><br />
I get no errors relating to element12<br />
I would expect that element0 should result in {0, 1, 2, 3}. It's the right "shape". Instead I get an error:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="font-family: monospace;" class="mycode_font"><br />
array_test.bas:9: error: Syntax Error. Unexpected token '(' &lt;LP&gt;<br />
 </span></blockquote>
<br />
I've tried variants e.g. data_array(0, : ) or data_array(0,0 TO 3). Nothing seems to work.<br />
<br />
I'm using ZX BASIC 1.17.2]]></description>
			<content:encoded><![CDATA[I've been enjoying using ZX BASIC so far. It's great to have something that's easy to use (and in-keeping with the original Sinclair BASIC). I have come up against an issue which I can't find a solution for:<br />
<br />
The compiler supports multi-dimensional arrays, but it throws an error if I attempt to get a "slice" of the data.<br />
<br />
My code:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>DIM data_array(0 TO 2, 0 TO 3) AS UByte = { _<br />
    {0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11} _<br />
}<br />
<br />
DIM element12 AS UByte = data_array(1, 2)<br />
<br />
DIM element0(0 TO 3) AS UByte<br />
<br />
element0 = data_array(0)  ' throws an error</code></div></div><br />
I get no errors relating to element12<br />
I would expect that element0 should result in {0, 1, 2, 3}. It's the right "shape". Instead I get an error:<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="font-family: monospace;" class="mycode_font"><br />
array_test.bas:9: error: Syntax Error. Unexpected token '(' &lt;LP&gt;<br />
 </span></blockquote>
<br />
I've tried variants e.g. data_array(0, : ) or data_array(0,0 TO 3). Nothing seems to work.<br />
<br />
I'm using ZX BASIC 1.17.2]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Breaking loops]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2608</link>
			<pubDate>Fri, 07 Feb 2025 12:28:26 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2201">baltasarq</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2608</guid>
			<description><![CDATA[Out of simple routine, I created a for loop like this:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>for i = 0 to ubound(m)<br />
    if m( i ) = 0<br />
        break<br />
    end if<br />
next</code></div></div><br />
At first, I did not understand what was happening. <span style="font-style: italic;" class="mycode_i">break</span> was not working. But there was not any error or even a warning. Then I realized: <span style="font-style: italic;" class="mycode_i">break</span> is not a part of Basic. It never was.<br />
The strange point is the absence of any error or warning. Either this was included in the grammar by error, or maybe because it is planned for inclusion.<br />
I don't know.]]></description>
			<content:encoded><![CDATA[Out of simple routine, I created a for loop like this:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>for i = 0 to ubound(m)<br />
    if m( i ) = 0<br />
        break<br />
    end if<br />
next</code></div></div><br />
At first, I did not understand what was happening. <span style="font-style: italic;" class="mycode_i">break</span> was not working. But there was not any error or even a warning. Then I realized: <span style="font-style: italic;" class="mycode_i">break</span> is not a part of Basic. It never was.<br />
The strange point is the absence of any error or warning. Either this was included in the grammar by error, or maybe because it is planned for inclusion.<br />
I don't know.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Colors only shown... sometimes?]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2595</link>
			<pubDate>Tue, 07 Jan 2025 13:21:21 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2201">baltasarq</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2595</guid>
			<description><![CDATA[Hi,<br />
<br />
I'm using <span style="font-style: italic;" class="mycode_i">print64.bas</span>, and the code I'm using to show a command menu is as follows:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>const COLOR_BLACK            as ubyte = 0<br />
const COLOR_BLUE              as ubyte = 1<br />
const COLOR_RED              as ubyte = 2<br />
const COLOR_MAGENTA          as ubyte = 3<br />
const COLOR_GREEN            as ubyte = 4<br />
const COLOR_CYAN              as ubyte = 5<br />
const COLOR_YELLOW            as ubyte = 6<br />
const COLOR_WHITE            as ubyte = 7<br />
<br />
<br />
sub cursor_to(row as ubyte, col as ubyte)<br />
    printat64( row, col )<br />
end sub<br />
<br />
<br />
sub cprint(s as string)<br />
    print64( s )<br />
end sub<br />
<br />
<br />
sub lf()<br />
    cprint( CR )<br />
end sub<br />
<br />
<br />
sub set_colors(i as ubyte, p as ubyte)<br />
    paper( p )<br />
    ink( i )<br />
end sub<br />
<br />
<br />
sub set_default_colors()<br />
    set_colors( COLOR_WHITE, COLOR_BLACK )<br />
end sub<br />
<br />
<br />
sub set_highlighted_colors()<br />
    set_colors( COLOR_CYAN, COLOR_BLACK )<br />
end sub<br />
<br />
<br />
sub set_action_colors()<br />
    set_colors( COLOR_YELLOW, COLOR_BLACK )<br />
end sub<br />
<br />
<br />
sub print_word_marked_initial(word as string)<br />
    set_action_colors()<br />
    cprint( word( 0 ) )<br />
    set_default_colors()<br />
    cprint( word( 1 to ) )<br />
end sub<br />
<br />
<br />
sub print_cmds()<br />
 ' Print basic options<br />
 cursor_to( SCR_FIRST_LINE_CMDS, 0 )<br />
 print_word_marked_initial( "Inv " )<br />
 print_word_marked_initial( "Mira alrededor " )<br />
 cprint( "E" ): print_word_marked_initial( "xamina... " )<br />
 print_word_marked_initial( "Norte " )<br />
 print_word_marked_initial( "Sur " )<br />
 print_word_marked_initial( "Este " )<br />
 print_word_marked_initial( "Oeste " )<br />
 print_word_marked_initial( "Arriba " )<br />
 cprint( "A" )<br />
        print_word_marked_initial( "bajo" )<br />
        lf()<br />
<br />
 ' Print object manipulation options<br />
 print_word_marked_initial( "Coge... " )<br />
 print_word_marked_initial( "Deja... " )<br />
 cprint( "Em" ): print_word_marked_initial( "puja... " )<br />
 print_word_marked_initial( "Tira de... " )<br />
 print_word_marked_initial( "Rompe... " )<br />
end sub</code></div></div><br />
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).<br />
<br />
What could be wrong?<br />
<br />
-- Baltasar<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=342" target="_blank" title="">speccy_reveni_cmds.png</a> (Size: 4.33 KB / Downloads: 549)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I'm using <span style="font-style: italic;" class="mycode_i">print64.bas</span>, and the code I'm using to show a command menu is as follows:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>const COLOR_BLACK            as ubyte = 0<br />
const COLOR_BLUE              as ubyte = 1<br />
const COLOR_RED              as ubyte = 2<br />
const COLOR_MAGENTA          as ubyte = 3<br />
const COLOR_GREEN            as ubyte = 4<br />
const COLOR_CYAN              as ubyte = 5<br />
const COLOR_YELLOW            as ubyte = 6<br />
const COLOR_WHITE            as ubyte = 7<br />
<br />
<br />
sub cursor_to(row as ubyte, col as ubyte)<br />
    printat64( row, col )<br />
end sub<br />
<br />
<br />
sub cprint(s as string)<br />
    print64( s )<br />
end sub<br />
<br />
<br />
sub lf()<br />
    cprint( CR )<br />
end sub<br />
<br />
<br />
sub set_colors(i as ubyte, p as ubyte)<br />
    paper( p )<br />
    ink( i )<br />
end sub<br />
<br />
<br />
sub set_default_colors()<br />
    set_colors( COLOR_WHITE, COLOR_BLACK )<br />
end sub<br />
<br />
<br />
sub set_highlighted_colors()<br />
    set_colors( COLOR_CYAN, COLOR_BLACK )<br />
end sub<br />
<br />
<br />
sub set_action_colors()<br />
    set_colors( COLOR_YELLOW, COLOR_BLACK )<br />
end sub<br />
<br />
<br />
sub print_word_marked_initial(word as string)<br />
    set_action_colors()<br />
    cprint( word( 0 ) )<br />
    set_default_colors()<br />
    cprint( word( 1 to ) )<br />
end sub<br />
<br />
<br />
sub print_cmds()<br />
 ' Print basic options<br />
 cursor_to( SCR_FIRST_LINE_CMDS, 0 )<br />
 print_word_marked_initial( "Inv " )<br />
 print_word_marked_initial( "Mira alrededor " )<br />
 cprint( "E" ): print_word_marked_initial( "xamina... " )<br />
 print_word_marked_initial( "Norte " )<br />
 print_word_marked_initial( "Sur " )<br />
 print_word_marked_initial( "Este " )<br />
 print_word_marked_initial( "Oeste " )<br />
 print_word_marked_initial( "Arriba " )<br />
 cprint( "A" )<br />
        print_word_marked_initial( "bajo" )<br />
        lf()<br />
<br />
 ' Print object manipulation options<br />
 print_word_marked_initial( "Coge... " )<br />
 print_word_marked_initial( "Deja... " )<br />
 cprint( "Em" ): print_word_marked_initial( "puja... " )<br />
 print_word_marked_initial( "Tira de... " )<br />
 print_word_marked_initial( "Rompe... " )<br />
end sub</code></div></div><br />
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).<br />
<br />
What could be wrong?<br />
<br />
-- Baltasar<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=342" target="_blank" title="">speccy_reveni_cmds.png</a> (Size: 4.33 KB / Downloads: 549)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[strange behaviour of raise to power]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2593</link>
			<pubDate>Sun, 05 Jan 2025 12:53:33 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2204">jjluke65</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2593</guid>
			<description><![CDATA[In this code:<br />
<br />
DIM x1, x2 AS float<br />
x1 = -3<br />
x2 = x1^2<br />
PRINT x2<br />
<br />
<br />
if x1 = 3 (or any positive number) the correct result (9) is printed.<br />
If x1 = -3  I get no result in the output (nothing is printed on the screen) and no message is shown.<br />
I've tried to define x1 and x2 as integer, with the same problem.<br />
I'm using 1.17.3 version with ZX Basic Studio, but I also tried with Visual Studio Code and Fuse (same result).<br />
I'm doing something wrong or it's a bug?<br />
Thanks]]></description>
			<content:encoded><![CDATA[In this code:<br />
<br />
DIM x1, x2 AS float<br />
x1 = -3<br />
x2 = x1^2<br />
PRINT x2<br />
<br />
<br />
if x1 = 3 (or any positive number) the correct result (9) is printed.<br />
If x1 = -3  I get no result in the output (nothing is printed on the screen) and no message is shown.<br />
I've tried to define x1 and x2 as integer, with the same problem.<br />
I'm using 1.17.3 version with ZX Basic Studio, but I also tried with Visual Studio Code and Fuse (same result).<br />
I'm doing something wrong or it's a bug?<br />
Thanks]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[pascalated boriel zx basic for the spectrum (*solved*)]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2591</link>
			<pubDate>Tue, 31 Dec 2024 09:13:10 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2198">funkheld</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2591</guid>
			<description><![CDATA[Hello, good day.<br />
will the tap program be faster with this new Pascal or is it just an optical design for the eye?<br />
<br />
<a href="https://arcalusitana.org/MuseuZX/Pascalated_ZXBASIC/" target="_blank" rel="noopener" class="mycode_url">https://arcalusitana.org/MuseuZX/Pascalated_ZXBASIC/</a><br />
<br />
Thanks.<br />
greeting]]></description>
			<content:encoded><![CDATA[Hello, good day.<br />
will the tap program be faster with this new Pascal or is it just an optical design for the eye?<br />
<br />
<a href="https://arcalusitana.org/MuseuZX/Pascalated_ZXBASIC/" target="_blank" rel="noopener" class="mycode_url">https://arcalusitana.org/MuseuZX/Pascalated_ZXBASIC/</a><br />
<br />
Thanks.<br />
greeting]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Compiler gives strange error message (solved)]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2590</link>
			<pubDate>Sun, 29 Dec 2024 22:31:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2201">baltasarq</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2590</guid>
			<description><![CDATA[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:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>reveni.bas:46: error: Can't convert non-numeric value to string at compile time<br />
reveni.bas:44: error: Can't convert non-numeric value to string at compile time</code></div></div>The second error is signaling a line that... is empty! The first error refers to the following source:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>clrscr()</code></div></div>I think this means that the compiler gets somehow confused about something. I'm attaching the project.<br />
Thanks,<br />
-- Baltasar<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=341" target="_blank" title="">reveni.zip</a> (Size: 12.2 KB / Downloads: 521)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[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:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>reveni.bas:46: error: Can't convert non-numeric value to string at compile time<br />
reveni.bas:44: error: Can't convert non-numeric value to string at compile time</code></div></div>The second error is signaling a line that... is empty! The first error refers to the following source:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>clrscr()</code></div></div>I think this means that the compiler gets somehow confused about something. I'm attaching the project.<br />
Thanks,<br />
-- Baltasar<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=341" target="_blank" title="">reveni.zip</a> (Size: 12.2 KB / Downloads: 521)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Compiler crash (solved)]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2587</link>
			<pubDate>Sun, 15 Dec 2024 20:54:36 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2201">baltasarq</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2587</guid>
			<description><![CDATA[I've run into a crash while compiling my project:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36; python ~/bin/zxbasic/zxbc.py --tap --BASIC --autorun reveni.bas<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:50: warning: [W150] Parameter 'scancode' is never used<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/print64.bas:20: warning: [W150] Parameter 'characters' is never used<br />
cmd.bas:41: warning: [W150] Parameter 'cmd' is never used<br />
io.bas:222: warning: [W100] Using default implicit type 'float' for 'current_loc'<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:51: warning: [W190] Function 'MultiKeys' should return a value<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:72: warning: [W190] Function 'GetKeyScanCode' should return a value<br />
objs.bas:88: warning: [W170] Function 'get_objs_in' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:50: warning: [W170] Function 'MultiKeys' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:71: warning: [W170] Function 'GetKeyScanCode' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:29: warning: [W170] Function 'mid' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:40: warning: [W170] Function 'left' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:51: warning: [W170] Function 'right' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:98: warning: [W170] Function 'strpos' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:124: warning: [W170] Function 'ucase2' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:174: warning: [W170] Function 'ucase' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:249: warning: [W170] Function 'ltrim' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:275: warning: [W170] Function 'rtrim' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:304: warning: [W170] Function 'trim' is never called and has been ignored<br />
util.bas:47: warning: [W170] Function 'testMultiplyStr' is never called and has been ignored<br />
util.bas:57: warning: [W170] Function 'testFormatStr' is never called and has been ignored<br />
Traceback (most recent call last):<br />
  File "/home/baltasarq/bin/zxbasic/zxbc.py", line 12, in &lt;module&gt;<br />
    sys.exit(zxbc.main())  # Exit<br />
            ^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/zxbc/zxbc.py", line 110, in main<br />
    optimizer.visit(zxbparser.ast)<br />
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 199, in visit<br />
    return super().visit(node)<br />
          ^^^^^^^^^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 56, in visit<br />
    return super().visit(ToVisit(node))<br />
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/ast/ast.py", line 42, in visit<br />
    stack.append(last.send(last_result))<br />
                ^^^^^^^^^^^^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 423, in visit_FOR<br />
    if from_ &gt; to_ and step_ &gt; 0:<br />
      ^^^^^^^^^^^<br />
TypeError: '&gt;' not supported between instances of 'SymbolID' and 'SymbolID'</code></div></div><br />
-- Baltasar<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=340" target="_blank" title="">reveni.zip</a> (Size: 11.6 KB / Downloads: 551)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[I've run into a crash while compiling my project:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&#36; python ~/bin/zxbasic/zxbc.py --tap --BASIC --autorun reveni.bas<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:50: warning: [W150] Parameter 'scancode' is never used<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/print64.bas:20: warning: [W150] Parameter 'characters' is never used<br />
cmd.bas:41: warning: [W150] Parameter 'cmd' is never used<br />
io.bas:222: warning: [W100] Using default implicit type 'float' for 'current_loc'<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:51: warning: [W190] Function 'MultiKeys' should return a value<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:72: warning: [W190] Function 'GetKeyScanCode' should return a value<br />
objs.bas:88: warning: [W170] Function 'get_objs_in' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:50: warning: [W170] Function 'MultiKeys' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:71: warning: [W170] Function 'GetKeyScanCode' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:29: warning: [W170] Function 'mid' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:40: warning: [W170] Function 'left' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:51: warning: [W170] Function 'right' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:98: warning: [W170] Function 'strpos' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:124: warning: [W170] Function 'ucase2' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:174: warning: [W170] Function 'ucase' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:249: warning: [W170] Function 'ltrim' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:275: warning: [W170] Function 'rtrim' is never called and has been ignored<br />
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:304: warning: [W170] Function 'trim' is never called and has been ignored<br />
util.bas:47: warning: [W170] Function 'testMultiplyStr' is never called and has been ignored<br />
util.bas:57: warning: [W170] Function 'testFormatStr' is never called and has been ignored<br />
Traceback (most recent call last):<br />
  File "/home/baltasarq/bin/zxbasic/zxbc.py", line 12, in &lt;module&gt;<br />
    sys.exit(zxbc.main())  # Exit<br />
            ^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/zxbc/zxbc.py", line 110, in main<br />
    optimizer.visit(zxbparser.ast)<br />
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 199, in visit<br />
    return super().visit(node)<br />
          ^^^^^^^^^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 56, in visit<br />
    return super().visit(ToVisit(node))<br />
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/ast/ast.py", line 42, in visit<br />
    stack.append(last.send(last_result))<br />
                ^^^^^^^^^^^^^^^^^^^^^^<br />
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 423, in visit_FOR<br />
    if from_ &gt; to_ and step_ &gt; 0:<br />
      ^^^^^^^^^^^<br />
TypeError: '&gt;' not supported between instances of 'SymbolID' and 'SymbolID'</code></div></div><br />
-- Baltasar<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=340" target="_blank" title="">reveni.zip</a> (Size: 11.6 KB / Downloads: 551)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Better parameters mismatch function (solved)]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2582</link>
			<pubDate>Fri, 13 Dec 2024 21:29:52 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2201">baltasarq</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2582</guid>
			<description><![CDATA[I was compiling my program when the compiler claimed (correctly) that there was an error in my code:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>util.bas:105: error: Function 'FormatStr' takes 3 parameters, not 1</code></div></div>This message was correct, but instead of signaling the file name and the line where the error was present, it was showing the line number and the file name of where the function was defined!<br />
It also messes with the line number, which corresponds to where the error happened, not where the function was defined. In my case, the error happened at line number 105 of <span style="font-style: italic;" class="mycode_i">player.bas</span>, calling function <span style="font-style: italic;" class="mycode_i">FormatStr()</span> defined in line number 39 of <span style="font-style: italic;" class="mycode_i">util.bas</span>.<br />
I think it would be better to expose both pieces of information, maybe this way:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>player.bas: 105: error: Function 'FormatStr' takes 3 parameters, not 1<br />
util.bas:39: error: Function 'FormatStr' defined here.</code></div></div>Well, something like that.]]></description>
			<content:encoded><![CDATA[I was compiling my program when the compiler claimed (correctly) that there was an error in my code:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>util.bas:105: error: Function 'FormatStr' takes 3 parameters, not 1</code></div></div>This message was correct, but instead of signaling the file name and the line where the error was present, it was showing the line number and the file name of where the function was defined!<br />
It also messes with the line number, which corresponds to where the error happened, not where the function was defined. In my case, the error happened at line number 105 of <span style="font-style: italic;" class="mycode_i">player.bas</span>, calling function <span style="font-style: italic;" class="mycode_i">FormatStr()</span> defined in line number 39 of <span style="font-style: italic;" class="mycode_i">util.bas</span>.<br />
I think it would be better to expose both pieces of information, maybe this way:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>player.bas: 105: error: Function 'FormatStr' takes 3 parameters, not 1<br />
util.bas:39: error: Function 'FormatStr' defined here.</code></div></div>Well, something like that.]]></content:encoded>
		</item>
	</channel>
</rss>