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.

DarkBASIC Professional Discussion / Entering array data

Author
Message
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 3rd Jan 2003 15:35
Is there a way to quickly enter array data. So instead of..

myArray(1)=1
myArray(2)=0
myArray(3)=1
myArray(4)=0
myArray(5)=0
myArray(6)=1

Can i dod something like:

myArray()=1,0,1,0,0,1

?
mimesis
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Norway
Posted: 3rd Jan 2003 15:46
This should be simple enough.

for i=1 to 6
read value
myArray(i)=value
next i
data 1,0,1,1,0,1
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 3rd Jan 2003 17:00
Ah I see. Many thanks.

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 3rd Jan 2003 23:55
I always thought the dimming and data statements had to come before the read statement. I was going to ask a question, but it was answered in the help files. The data can be anywhere, as long as there are enough read statements and they are in the right order to receive the correct data types from the data statements.

Login to post a reply

Server time is: 2024-05-17 03:33:03
Your offset time is: 2024-05-17 03:33:03