Welcome, Guest. Please login or register.

Author Topic: AmigaBasic revisited  (Read 5036 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: AmigaBasic revisited
« on: February 18, 2003, 02:23:03 PM »
I'm no BASIC man, as anybody checking the developer forum could vouch for by now ;-), but I'll have a go..

I think your problem comes down to the fact that your 'y' variable is initialized with the value 1 every time you call the subroutine. The subroutine returns  immediately because of the 'if y<25 then return' condition. Consequently, y never gets to 25 and you don't get your carriage return.

You could just use a modulus of your 'x' value in the main loop. Not sure about the syntax, but something like

for x=0 to 255
print chr$(x)
if x%25 == 0 then print chrs$(13)
next x

Does BASIC have a modulus anybody?

In any event, bear in mind that there are lots of unprintable characters before when x < 32
int p; // A