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 / #100013 Command line out of place at line 87

Author
Message
DWman
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location:
Posted: 23rd Jun 2004 20:51
Here is the code for a simple program i created (i started Dark BASIC about 3 days ago!)

I recieve this error when trying to run it:

#100013 Command line out of place at line 87

It is referring to the LOOP command at the end of the code.
Any ideas?
Thanks...

Dave W
n00b
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location: tampa,FL
Posted: 23rd Jun 2004 21:26
im kind of a noob but ill take a look at it i think i already see the problem but ill look at it.

i will...WIN!
DWman
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location:
Posted: 23rd Jun 2004 21:34
Thanks
I owe you one
I doubt i can help you with dark BASIC, but, i still owe you one
Thanks again

Dave W
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 24th Jun 2004 08:15
The error I think you're getting is a reply to the line;
B=2A
Which is formatted incorrectly for "Here is the number you entered doubled."
The correct line should be;
B = 2*A
the asterisk being Multiply. Programming is not like math class, you must include the operations between the values.
X=ABC is wrong, X = A*B*C is right...

s.

Any truly great code should be indisguishable from magic.
Bean
20
Years of Service
User Offline
Joined: 23rd Mar 2004
Location: Flower Mound Texas
Posted: 24th Jun 2004 10:35
Look at the attached code. I got it to work for you but it's not very pretty. You will still have plenty of work formatting etc.
Sandrad was totally correct about the math variable. B=2A sould be B=2*A.
To get the program to run I removed all the embedded IF statements in your code. Just compare with your original to see where this was done. I'll leave it as an exercise for you to find out why it wasn't working!
Additionally, you had the variable GamesPlayed misspelled toward the bottom of your code. Good luck !
DWman
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location:
Posted: 25th Jun 2004 14:46
Thanks for helping me, i understand what i was doing wrong. Thanks alot. I have one more problem relating to new things i am trying. The command load bitmap"..." gives me an error. Do you know what this could be? do i need some other commands to get it to load?

Dave W
DWman
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location:
Posted: 25th Jun 2004 14:51
My next project is naughts and crosses! I can do it all, but struggle on AI. Can you recommend a good tutrorial and any other tutorials that helped you become a programming genius (that is called sucking up!!!!!) Thanks alot for giving your time to help me out....

Dave W
Bean
20
Years of Service
User Offline
Joined: 23rd Mar 2004
Location: Flower Mound Texas
Posted: 25th Jun 2004 23:29 Edited at: 25th Jun 2004 23:37
It would be helpful to know exactly what the error is to help with any kind of diagnosis. Try to place a bit of code in your post to see what is going on and maybe cut and paste the error message also.

One bit of advice - when an error is trapped, the line number given is usually not correct. It's the error message that you will have to track down.

There are several tutorials on these forums that will be quite useful to you. Just do a search for 'tutorials' and I feel confident that you will find plenty to keep you busy. There are quite a few good programmers that will bend over backwards to help you out - like CattleRustler, Scouseknight, Zenassem, Emperor Baal, SandraD, Raven etc. etc. etc.
The forums will be your best friend - just treat them with respect and they will help you out.
take care -
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Jun 2004 00:17 Edited at: 26th Jun 2004 00:18
bean, thanks but please dont forget IanM,TCA,ApexNow,VanB and Exeat - and others!



Edit: Mentor too!


* DBP_NETLIB_v1.4 - w/VARIABLE WATCHER & CONSOLE! * Click Logo
Bean
20
Years of Service
User Offline
Joined: 23rd Mar 2004
Location: Flower Mound Texas
Posted: 26th Jun 2004 00:43
Absolutely !!
DWman
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location:
Posted: 27th Jun 2004 21:32
Hey, its me again
I am currently trying to write my first (remotely interesting) program -Naughts and Crosses. I have decided to forget AI for the moment and decided that ill be the AI (so ill decide where the computer goes) Here is some code of it:
If you run it and click on a square in the grid, the circle stays there only while the left button is pressed, how can i make it stay there?
Thanks

Dave W
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 27th Jun 2004 22:40
It want stay because you are using CLS every time your program loops. Doesn't DBC have sync commands? If not you could do something like this...


DWman
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location:
Posted: 30th Jun 2004 17:56
Thanks 'Lost in thought', I've got it working using the idea ofwhat you said.
New Problem!
What is wrong with this command:

TEXT 270,502, "You have won ;GamesWon; times(s)"

I want to record how many times the player has won the game, using the variable GamesWon, but it just prints GamesWon instead of the number! Help please...

Dave W
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Jun 2004 21:56 Edited at: 30th Jun 2004 21:57
TEXT 270,502, "You have won ";GamesWon;" times(s)"

or

TEXT 270,502, "You have won "+GamesWon+" times(s)"

if GamesOne is numeric you might want to get used to doing...

TEXT 270,502, "You have won ";str$(GamesWon);" times(s)"

although from what I hear the TEXT command implies the type conversion of numeric variables to string for printing. You can also do...

SET CURSOR 270,502
PRINT "You have won "+str$(GamesWon)+" times(s)"


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
DWman
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location:
Posted: 1st Jul 2004 00:43
Thanks, its working, i used the PRINT command that seemed to fix it!
Ill tell you any further problems (which im sure there will be!)
Thanks again........

Dave W
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st Jul 2004 01:24
no problem, if you notice, the original problem was that you were not wrapping your string-literals in quotes...

you had
"You have won ;GamesWon; times(s)"

but it needed to be
"You have won ";GamesWon;" times(s)"

sorry I didnt mention that before


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
Neil19533
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: England
Posted: 2nd Jul 2004 20:37
or instead of time(s) put an if statement



Any spelling mistakes are totally In tensional.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd Jul 2004 22:42
probably only need SET CURSOR once, I believe.


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo

Login to post a reply

Server time is: 2024-11-26 23:37:20
Your offset time is: 2024-11-26 23:37:20