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 / How Do I count Line numbers in DB Lite?

Author
Message
Raybrite2
15
Years of Service
User Offline
Joined: 16th May 2009
Location: Cyberspace
Posted: 15th Jun 2009 02:08
I have a program that I am having problems with. I have taken all the empty lines out except one.
I get a nexting error at line 38 error.
The Loop statement (which is the last one) is on line 32 if I count them from the top.
How do you count the line numbers?
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Jun 2009 02:13
dont try

DBC is stupid in how it tells you what line the error is on

just look for the error anywhere from that line to about 10 lines above it

and as i said on the other thread, give me the code and ill helkp you

There are only 10 kinds of people in the world, those who understand binary and those who dont
Raybrite2
15
Years of Service
User Offline
Joined: 16th May 2009
Location: Cyberspace
Posted: 15th Jun 2009 02:21


I get a nesting error. No lines are lit up.
(I didn't think you were online. I am in the Philippines and just woke up. Most people are either off or in bed now.)
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Jun 2009 02:31 Edited at: 15th Jun 2009 02:32
DarkBasic doesn't require :'s after every line. That is probably your problem.

To DBC, a : means that it is a label or you will put an additional command after it. My guess is that that has something to do with it.

Nevermind, here is the problem.


Should read (I will omit code and just put the if's and loops. Bold will be commands you skipped that need to be there). I used quote instead of code so that the bold would show.


Quote: "
If Guess = MyNumber:

Repeat

Until I$="Y" or I$="N"
If I$="Y"

Else

Endif
ENDIF"


Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Jun 2009 02:34 Edited at: 15th Jun 2009 02:35
its not like posts disappear over time, just post it and i would have seen it sooner or later

anyway, back to the colons, ill just come right out and say it, remove them all!

colons are only used to put 2 or more codes on 1 line, put a colon between two commands and they both will coexist perfectly on one line

you have none of these cases so just remove all the colons from your code and tell me what happens

edit:

whoops forgot to mention labels, bn2 is right about how you need one after your Start label, so leave that one and remove the rest, then do what bn2 suggested

There are only 10 kinds of people in the world, those who understand binary and those who dont
Raybrite2
15
Years of Service
User Offline
Joined: 16th May 2009
Location: Cyberspace
Posted: 15th Jun 2009 02:54
Took out the colons and added in the other Endif statement.



I must figure out what is happening. When I make a correct guess, it doesn't count it. Said 2 was too low and 3 was too high.
I will figure this one out.
Either it is making a new guess with eash guess or it is using decimals.
(BTW That1SmartGuy.. I am the old guy on the other post if you haven't figured it out.)
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Jun 2009 02:59
it works fine for me

There are only 10 kinds of people in the world, those who understand binary and those who dont
Raybrite2
15
Years of Service
User Offline
Joined: 16th May 2009
Location: Cyberspace
Posted: 15th Jun 2009 03:05
I think I may have been typing a number and my computer did not see it. ( I would type 30 and the computer would miss the 3 and only register 0)
The program is working fine. I need to go to the next tutorial now and hope I don't have many more problems.
Thanks for the help.
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Jun 2009 03:08
np, thats what this forum is for

There are only 10 kinds of people in the world, those who understand binary and those who dont
Raybrite2
15
Years of Service
User Offline
Joined: 16th May 2009
Location: Cyberspace
Posted: 18th Jun 2009 09:24
I moved up to DB Pro because I kept running into commands that won't work with DB Lite.
They list the program numbers in the new version. They also color code things for you so they stand out. A great improvement.
Now I must get used to the commands from DB lite that don't work with DB Pro. (CLS)
I am still learning and the only thing I have made anything on is FPS Creator.
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 18th Jun 2009 21:46
Quote: "They also color code things for you so they stand out. A great improvement."

If you mean syntax highlighting (all the text in the editor shows (say) red for keywords, blue for variables, that kind of thing) then you might just want to get a new code editor - after all, the one that DBC uses by default is pretty awful. I use Dark Edit myself, it's a brilliant editor.

Quote: "I am still learning and the only thing I have made anything on is FPS Creator. "

Don't worry, you'll master the basics of DB pretty quickly, then its just a case of having a good idea for a project and seeing it through to the end.

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Jun 2009 21:54 Edited at: 18th Jun 2009 21:54
I don't know why TGC hide DarkEdit it took me about a year to find it!
I didn't know it existed, I'm not THAT bad at finding files lol

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 18th Jun 2009 22:00
Quote: "I didn't know it existed"

Really??

It came with DBC on the disc I bought a few years ago, automatically installed. The DarkEdit exe was located in the same folder as DB.exe, along with a zip archive that held DarkEdit and all necessary files.

Maybe someone ought to put together a thread giving download links of every good editor around...

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Jun 2009 22:10
Yeah it came with my DBC too but I didn't know about it until I stumbled upon it by chance.

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer

Login to post a reply

Server time is: 2024-05-20 13:19:38
Your offset time is: 2024-05-20 13:19:38