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 Discussion / Code question

Author
Message
David B
22
Years of Service
User Offline
Joined: 1st Mar 2003
Location:
Posted: 2nd Mar 2003 00:35
Is there a maximum length to a line of code. To be specific, If I want to have a Data line with 500 integers will that be allowed?
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 2nd Mar 2003 00:42
In DBC there is a limit to 256 characters line length, and you are only allowed about 30-40 data items on one line. You can still break up that 500 long list into more lines, DB will still read the data in the same way.



will work the same way as



Once I was but the learner,
now, I am the Master.
Red Giant 2183
22
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 2nd Mar 2003 19:20
why not do it in one line instead like this :

dim yourarray(500)

this gives you 500 integers and only uses the fraction of the space you need to write out seperate variables.
just be sure and make a personal list of what each variable slot does :
remstart
1-
2-
ect,...
remend

RGteam~
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 2nd Mar 2003 23:01
Red Giant, your comments are valid, but the point was how to put useful information into those 500 array slots. The question was whether you can have 500 items in a single data statement, and the answer is no. However I've provided an alternative, splitting up the long data statement into pieces, which are read in exactly the same way.

Of course the author may not know about arrays, I only assumed so because he used the term 'data line' containing more than one item.

Once I was but the learner,
now, I am the Master.
Red Giant 2183
22
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 4th Mar 2003 23:08
oh ok, i see what you mean. i thought he was refering to having 500 variables , so i misread. [sorry ]

RGteam~
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 5th Mar 2003 00:06
That's ok. Making mistakes is how we learn. That, and just reading stuff from books/the internet.

Once I was but the learner,
now, I am the Master.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 5th Mar 2003 04:22
I thought when I have a long line it says

Error: Blah blah blah line excedes 255 characters. Dunno!

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Mar 2003 12:08
i just wish we could split up the bloody lines, like i'll have a line of
if... and
and
and
endif
but for some reason the compiler even for Pro doesn't like the &&'s being on a seperate line, so i either have to shrink it down or redo the IF...ENDIF which is a pain in the ass cause it doesn't work the same when you seperate them (and i'm still unsure why)

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
cusoi
22
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: Netherlands
Posted: 5th Mar 2003 14:07
@Raven:
if a=1 and b=2
endif
is the same as
if a=1
if b=2
endif
endif
At my computer it works the same.

Current project: Earth Chaos, a FPRTS

Login to post a reply

Server time is: 2025-08-08 20:40:14
Your offset time is: 2025-08-08 20:40:14