| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 158 online users. » 0 Member(s) | 154 Guest(s) Applebot, Baidu, Bing, Google
|
| Latest Threads |
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 142
|
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 110
|
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 165
|
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 93
|
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 219
|
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 383
|
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: zedex82
2025-10-05, 07:36 PM
» Replies: 2
» Views: 281
|
CLS/Fade out ASM Sub-rout...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-05, 03:39 PM
» Replies: 2
» Views: 274
|
ZX Basic Studio Bugs
Forum: Bug Reports
Last Post: Duefectu
2025-09-23, 04:07 PM
» Replies: 5
» Views: 1,083
|
Printing with FZX
Forum: Help & Support
Last Post: boriel
2025-07-17, 10:08 PM
» Replies: 1
» Views: 1,967
|
|
|
| Using inkey |
|
Posted by: ardentcrest - 2015-01-20, 03:31 PM - Forum: Help & Support
- Replies (13)
|
 |
Any one know how to do something like this
I'm looking to use inkey$ to create a line of text while the program is doing some other things Ie
LOOP
DO THING 1
INKEY(text string)
DO THING 2
IF ENTER PRINT(text String)
GOTO LOOP
any help on this
|
|
|
| SAVE inside SUB freezes the program (*solved*) |
|
Posted by: juanjo - 2015-01-13, 06:59 AM - Forum: Bug Reports
- Replies (4)
|
 |
I'm making a program to print customized labels with the ZX Printer. I was going to make load/save of label data.
The problem is when using SAVE in any of its variants inside a SUB. It freezes after saving is done, and the saved data is different from when the SAVE is done in the 'main block'.
The LOAD command does work inside a SUB.
I don't know if it has some relation to the previous bug report about SAVE:
<!-- l --><a class="postlink-local" href="https://forum.boriel.com/bug-reports/save-bug-solved-t858.html">bug-reports/save-bug-solved-t858.html</a><!-- l -->
Here is a little program that reproduces the error:
Code: dim variableToSave as uinteger
variableToSave = 1234
sub saveSomething()
' This freezes the program AFTER saving is done
save "test1" DATA variableToSave
' This freezes the program AFTER saving is done and shows a funny "demo"
'save "test1" screen$
end sub
sub waitForAKey()
while inkey$=""
end while
while inkey$<>""
end while
end sub
print "Press any key to start save..."
waitForAKey()
saveSomething()
'This works (in the main block)
'save "test1" DATA variableToSave
print "Save done. Press any key to continue..."
waitForAKey()
' Do some random stuff (the Spectrum freezes before reaching here):
dim i as uinteger
i = 2 + 2
print "i = "; i
print "Press any key to exit..."
waitForAKey()
|
|
|
| Array initialization bug (*solved*) |
|
Posted by: einar - 2014-12-23, 03:28 AM - Forum: Bug Reports
- Replies (8)
|
 |
My next ZX BASIC game requires a lookup table for variable sized data.
The simplest solution would be something like this:
Code: data1:
asm
defb 0,1,2,3,4,5
end asm
data2:
asm
defb 6,7,8
end asm
data3:
asm
defb 9,10,11,12
end asm
DIM array(1 TO 3) AS UINTEGER = { @data1, @data2, @data3 }
But compiling this program using latest version of ZX BASIC (incorrectly) produces the following error messages:
Code: prog.bas:14: Initializer expression is not constant.
prog.bas:14: Initializer expression is not constant.
prog.bas:14: Initializer expression is not constant.
Another alternative would be declaring the lookup table directly in ASM, but ZX BASIC doesn't support mapping arrays to memory addresses either:
Code: DIM array(1 TO 3) AS UINTEGER AT @data
For now, I'm implementing everything "manually" instead of using ZX BASIC arrays. But it would be nice if this problem could be fixed in future releases!
|
|
|
|