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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 262
» Latest member: terrex
» Forum threads: 1,074
» Forum posts: 6,439

Full Statistics

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

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

 
  UBYTE/FOR loop issue?
Posted by: LTee - 02-25-2011, 01:07 PM - Forum: Help & Support - Replies (4)

I wrote the following code to list out the numbers from 0 to 255:

Code:
DIM i as UBYTE = 0
for i = 0 to 255
    print i;"   "
next i

The code compiles and runs, but it never ends. When the loop gets to 255, it begins again from 0. :-)

Making the loop "0 to 254" or changing i to an INTEGER/UINTEGER gets around the issue.

Print this item

  Pass an array as a parameter?
Posted by: LTee - 02-24-2011, 02:46 PM - Forum: Help & Support - Replies (3)

A question today, rather than a bug. :-)

Is it possible to pass an array as a parameter to a function or a sub?

And if so, does the function/sub receive a copy of the array or a pointer to the original? i.e. if I made changes to the array within a function, would those changes be local to the function or would they also be visible from the calling method?

Print this item

  ELSE issue? (*solved*)
Posted by: LTee - 02-23-2011, 04:29 PM - Forum: Bug Reports - Replies (12)

Have you had enough of me yet? :-D

I'm having a weird issue with ELSE, but I'm not sure if I'm doing something wrong or not. Take a look at this test program:

Code:
dim num as ubyte

cls
num = 1
test()
num = 2
test()
num = 3
test()
num = 4
test ()

sub test
    IF num = 1 THEN
        PRINT "1"
    ELSEIF num = 2 THEN
        PRINT "2"
    ELSEIF num = 3 THEN
        PRINT "3"
    ELSE
        PRINT "X"
    END IF
    PRINT "---"
end sub

I would expect the output from this to be like this:
Code:
1
---
2
---
3
---
X
---

But it's actually like this:
Code:
1
---
2
---
3
X
---
X
---

Condition "3" is running correctly, but the final ELSE block is also being processed so you get two lines output if num is 3. Have I messed up the syntax there? The behaviour is certainly different to how it used to be, as an old program that used to be okay is now failing.

I've tried this in 2100 and also 1866 and it does the same in both, so it must've been a while since I compiled it! :-)

Print this item

  Small brackets-parsing glitch (*solved*)
Posted by: LTee - 02-23-2011, 01:38 PM - Forum: Bug Reports - Replies (5)

Messing around with some of my other code over lunchtime with the latest beta (2100), I discovered a small error when parsing brackets.

Take a look at this code:

Code:
DIM test(10, 10) as UBYTE
DIM x as UBYTE
DIM y as UBYTE

x = 5
y = 5

PRINT test(x - 1, y)
PRINT test((x - 1), y)
PRINT test(x, y - 1)
PRINT test(x, (y - 1))

The final PRINT statement will not compile unless you remove the brackets from around the (y - 1). Strangely, the brackets seem to be okay if we're dealing with the first dimension of the array (so it's okay to have 'x - 1' in brackets), just not for the second. :-)

Print this item

  array bounds must be constant
Posted by: slenkar - 02-22-2011, 05:02 PM - Forum: Help & Support - Replies (11)

How do I create an array with an integer instead of a literal number?

I want to do this:

Code:
DIM personX (numPersons) as ubyte
DIM personY (numPersons) as ubyte
DIM personHealth (numPersons) as ubyte
DIM personWeapon (numPersons) as ubyte

instead of:
Code:
DIM personX (6) as ubyte
DIM personY (6) as ubyte
DIM personHealth (6) as ubyte
DIM personWeapon (6) as ubyte
just in case I decide to change my mind about the number of persons

Print this item

  UDG problem
Posted by: slenkar - 02-22-2011, 04:32 PM - Forum: Help & Support - No Replies

I have 2 graphics
factory.bin and select.bin

factory is 17 bytes and select.bin is 9 bytes

When I put include select.bin first the graphics work
but when i include factory.bin first the select.bin graphic is not shown on screen, it is just blank

both were created and exported from sevenup sprite editor.

Print this item

  too fast :)
Posted by: slenkar - 02-22-2011, 12:48 AM - Forum: Help & Support - Replies (8)

i have a cursor that i move around the screen with the keys but its too fast

when i press "p" it shoots half way across the screen, how do i make it move 1 square every half a second

Print this item

  clear ink from attr
Posted by: slenkar - 02-22-2011, 12:36 AM - Forum: Help & Support - Replies (6)

How do you use print to remove all ink from an attribute (8*8 square)

the opposite is 'print /::' to draw a block but i want to clear all ink away and leave the paper

Print this item

  Psyco for Python
Posted by: slenkar - 02-21-2011, 11:11 PM - Forum: Wishlist - Replies (2)

<!-- m --><a class="postlink" href="http://psyco.sourceforge.net/">http://psyco.sourceforge.net/</a><!-- m -->

Would this speed up compilation?

Print this item

  Vim users
Posted by: slenkar - 02-21-2011, 10:57 PM - Forum: Help & Support - Replies (1)

I can highlight the syntax but how do people use the zxb.exe compiler with vim?

Print this item