Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 190 online users. » 0 Member(s) | 188 Guest(s) Bing, Google
|
Latest Threads |
Strange Happenings
Forum: Bug Reports
Last Post: zedex82
05-07-2025, 09:05 AM
» Replies: 0
» Views: 26
|
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 405
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 323
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,644
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 589
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 925
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 367
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,123
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,913
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 437
|
|
|
Using inkey |
Posted by: ardentcrest - 01-20-2015, 02: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 - 01-13-2015, 05: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="http://www.boriel.com/forum/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 - 12-23-2014, 02: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!
|
|
|
|