Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 260
» Latest member: Dekxter
» Forum threads: 1,074
» Forum posts: 6,439

Full Statistics

Online Users
There are currently 259 online users.
» 0 Member(s) | 257 Guest(s)
Bing, Google

Latest Threads
Printing with FZX
Forum: Help & Support
Last Post: boriel
07-17-2025, 09:08 PM
» Replies: 1
» Views: 334
Strange Happenings
Forum: Bug Reports
Last Post: boriel
05-23-2025, 09:15 AM
» Replies: 4
» Views: 2,503
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 2,694
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 2,247
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 5,212
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 3,675
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 3,410
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 1,927
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 4,682
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 5,397

 
  Play on a bank ($c000) in spectrum128 and then copy to $4000
Posted by: funkheld - 01-05-2025, 02:06 PM - Forum: How-To & Tutorials - Replies (4)

Hello, good day.

How can you play on the $c000 area if you have the Specrum128 mode? You can assign the banks to $c000.

thanks.
greetings

Print this item

  strange behaviour of raise to power
Posted by: jjluke65 - 01-05-2025, 12:53 PM - Forum: Bug Reports - Replies (2)

In this code:

DIM x1, x2 AS float
x1 = -3
x2 = x1^2
PRINT x2


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

Print this item

  pascalated boriel zx basic for the spectrum (*solved*)
Posted by: funkheld - 12-31-2024, 09:13 AM - Forum: Bug Reports - Replies (10)

Hello, good day.
will the tap program be faster with this new Pascal or is it just an optical design for the eye?

https://arcalusitana.org/MuseuZX/Pascalated_ZXBASIC/

Thanks.
greeting

Print this item

  Compiler gives strange error message (solved)
Posted by: baltasarq - 12-29-2024, 10:31 PM - Forum: Bug Reports - Replies (4)

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



Attached Files
.zip   reveni.zip (Size: 12.2 KB / Downloads: 308)
Print this item

  Puzzles
Posted by: zarsoft - 12-29-2024, 12:17 PM - Forum: Gallery - No Replies

To read the launch announcement, click HERE.
[Image: Puzzles%20(2024)%20%5BZarsoft%5D.png]
To play online, click HERE.

Print this item

  Compiler crash (solved)
Posted by: baltasarq - 12-15-2024, 08:54 PM - Forum: Bug Reports - Replies (3)

I've run into a crash while compiling my project:

Code:
$ python ~/bin/zxbasic/zxbc.py --tap --BASIC --autorun reveni.bas
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:50: warning: [W150] Parameter 'scancode' is never used
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/print64.bas:20: warning: [W150] Parameter 'characters' is never used
cmd.bas:41: warning: [W150] Parameter 'cmd' is never used
io.bas:222: warning: [W100] Using default implicit type 'float' for 'current_loc'
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:51: warning: [W190] Function 'MultiKeys' should return a value
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:72: warning: [W190] Function 'GetKeyScanCode' should return a value
objs.bas:88: warning: [W170] Function 'get_objs_in' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:50: warning: [W170] Function 'MultiKeys' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/keys.bas:71: warning: [W170] Function 'GetKeyScanCode' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:29: warning: [W170] Function 'mid' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:40: warning: [W170] Function 'left' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:51: warning: [W170] Function 'right' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:98: warning: [W170] Function 'strpos' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:124: warning: [W170] Function 'ucase2' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:174: warning: [W170] Function 'ucase' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:249: warning: [W170] Function 'ltrim' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:275: warning: [W170] Function 'rtrim' is never called and has been ignored
/home/baltasarq/bin/zxbasic/src/lib/arch/zx48k/stdlib/string.bas:304: warning: [W170] Function 'trim' is never called and has been ignored
util.bas:47: warning: [W170] Function 'testMultiplyStr' is never called and has been ignored
util.bas:57: warning: [W170] Function 'testFormatStr' is never called and has been ignored
Traceback (most recent call last):
  File "/home/baltasarq/bin/zxbasic/zxbc.py", line 12, in <module>
    sys.exit(zxbc.main())  # Exit
            ^^^^^^^^^^^
  File "/home/baltasarq/bin/zxbasic/src/zxbc/zxbc.py", line 110, in main
    optimizer.visit(zxbparser.ast)
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 199, in visit
    return super().visit(node)
          ^^^^^^^^^^^^^^^^^^^
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 56, in visit
    return super().visit(ToVisit(node))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/baltasarq/bin/zxbasic/src/ast/ast.py", line 42, in visit
    stack.append(last.send(last_result))
                ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/baltasarq/bin/zxbasic/src/api/optimize.py", line 423, in visit_FOR
    if from_ > to_ and step_ > 0:
      ^^^^^^^^^^^
TypeError: '>' not supported between instances of 'SymbolID' and 'SymbolID'

-- Baltasar



Attached Files
.zip   reveni.zip (Size: 11.6 KB / Downloads: 332)
Print this item

  Better parameters mismatch function (solved)
Posted by: baltasarq - 12-13-2024, 09:29 PM - Forum: Bug Reports - Replies (4)

I was compiling my program when the compiler claimed (correctly) that there was an error in my code:

Code:
util.bas:105: error: Function 'FormatStr' takes 3 parameters, not 1
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!
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 player.bas, calling function FormatStr() defined in line number 39 of util.bas.
I think it would be better to expose both pieces of information, maybe this way:
Code:
player.bas: 105: error: Function 'FormatStr' takes 3 parameters, not 1
util.bas:39: error: Function 'FormatStr' defined here.
Well, something like that.

Print this item

  String functions
Posted by: baltasarq - 12-13-2024, 09:15 PM - Forum: Wishlist - Replies (2)

I've found myself writing these functions:

Code:
' Duplicates the string for times times.
' For instance, MultiPlyStr( "0", 3 ) ' -> "000"
' times must be between 1 and 127
function MultiplyStr(ByVal s as string, ByVal times as byte) as string
    dim toret as string = ""
   
    if times > 0
        for i = 1 to times
            toret = toret + s
        next
    end if
   
    return toret
end function


' Returns a formatted string with the number n
' and enough preceding chars (the ch parameter),
' so that the length of the string is w or more.
' for instance, FormatStr(15, 4, "0") ' -> "0015"
' w must be between 1 and 127.
function FormatStr(ByVal n as integer, ByVal w as byte, ByVal ch as string) as string
    dim toret as string = str( n )
    dim len_prefix as byte = w - len( toret )
   
    return MultiplyStr( ch( 0 ), len_prefix ) + toret
end function


sub testMultiplyStr()
    print("'0' * -1: '" + MultiplyStr("0", -1) + "'")
    print("'0' * 0: '" + MultiplyStr("0", 0) + "'")
    print("'0' * 1: '" + MultiplyStr("0", 1) + "'")
    print("'0' * 2: '" + MultiplyStr("0", 2) + "'")
    print("'0' * 3: '" + MultiplyStr("0", 3) + "'")
    print("'0' * 4: '" + MultiplyStr("0", 4) + "'")
    print("'0' * 5: '" + MultiplyStr("0", 5) + "'")
end sub

sub testFormatStr()
    print("fmt(1, '0', -1): '" + FormatStr(1, -1, "0") + "'") 
    print("fmt(1, '0',  0): '" + FormatStr(1, 0, "0") + "'") 
    print("fmt(1, '0',  1): '" + FormatStr(1, 1, "0") + "'")
    print("fmt(1, '0',  2): '" + FormatStr(1, 2, "0") + "'")
    print("fmt(1, '0',  3): '" + FormatStr(1, 3, "0") + "'")
end sub
Would it be of interest to incorporate MultiplyStr() and FormatStr() to ZXBasic?
I can prepare a PR if there is interest.

Print this item

  transfer data to "the spectrum" with flashair.
Posted by: funkheld - 12-12-2024, 08:45 PM - Forum: How-To & Tutorials - No Replies

https://spectrumcomputing.co.uk/forums/v...hp?t=12620

hello, good day.

I transfer my data/programs from my notebook to "the spectrum" with flashair.

works great.

greetings

Print this item

  char pointer bend to another address
Posted by: funkheld - 11-29-2024, 01:42 PM - Forum: How-To & Tutorials - Replies (11)

hello, good day.

how can you change the character pointer to another address to create new characters?

I want to change all characters.

greetings

Print this item