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 / a complete n00b says...

Author
Message
Codelike
18
Years of Service
User Offline
Joined: 13th Dec 2005
Location: DBP - Scouseland
Posted: 13th Dec 2005 11:49
word$="hello"
print word$



I'd like to use a numeric array

dim num(3)
num(0)=0
num(1)=1
num(2)=5
num(3)=10

etc...

to shorten this code. Could anyone point me in the right direction?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 13th Dec 2005 17:18
I think you need to look at loops and endwhile statements
start with a for / next command



do you mean something like this?

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself 
Codelike
18
Years of Service
User Offline
Joined: 13th Dec 2005
Location: DBP - Scouseland
Posted: 13th Dec 2005 17:28
word$=\"hello\"
print word$



I\'d like to use a numeric array

dim num(3)
num(0)=0
num(1)=1
num(2)=5
num(3)=10

etc...

to shorten this code. Could anyone point me in the right direction?

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Dec 2005 23:15 Edited at: 13th Dec 2005 23:24
Here ya go.




Codelike
18
Years of Service
User Offline
Joined: 13th Dec 2005
Location: DBP - Scouseland
Posted: 14th Dec 2005 11:25


Thanks Grog!
I understand it now that someone's put the code in front of me!
I've had a go at for/next, already, but couldn't seem to get it to work. You're a great help.
I've re-edited to code to take the text out of (large texted) graphics mode. Here it is...

n.b. I'm using DBPv5.9



I tried BBC Basic 20 years ago...

Login to post a reply

Server time is: 2024-09-24 11:25:43
Your offset time is: 2024-09-24 11:25:43