Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / doing my head in - easy question probably

Author
Message
thecyke
21
Years of Service
User Offline
Joined: 20th Feb 2003
Location:
Posted: 21st Feb 2003 02:07
quick q;

I cant get the print command working fully, i need it to keep printing on the same line. the manual mentions the semi-colon being used. heres my code;

FOR x = 1 to 100
FOR y = 1 to 100

maptileshade=RND(5)
print maptileshade ;
map(x,y) = maptileshade

NEXT y
NEXT x

the fact i`m printing a variable seems to be the issue? tried quotes etc, no joy.

(i`m basically populating a grid here and want to see the data a certain way as it goes in)

thanks for any help
SasukiShinozawa
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 21st Feb 2003 02:12
No, just put this right before your print line:
Set cursor 10, 10.

That'll keep it in the right place.

Tanto? Iie. Kore wa tachi desu.
SasukiShinozawa
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 21st Feb 2003 02:14
Whoops, that would make it print all the data into one messy unreadable line.

Try this:

Dim TextY as Integer
TextY = 10

FOR x = 1 to 100
FOR y = 1 to 100

maptileshade=RND(5)
set cursor 10, TextY
TextY = TextY + 10
print maptileshade ;
map(x,y) = maptileshade

NEXT y
NEXT x

Tanto? Iie. Kore wa tachi desu.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 21st Feb 2003 02:14
here u go


either there was an array in your code previously that u didnt mention declared that stopped it from running, or the space after the printed variable between the semi colon had something to do with it not working.




Login to post a reply

Server time is: 2024-11-24 03:59:48
Your offset time is: 2024-11-24 03:59:48