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 / Question On Program I am making

Author
Message
Jim T
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location:
Posted: 11th Feb 2004 20:53
Im trying my first program which may or may not work but when i do a debug i keep getting

Quote: "#100002 Types '@answer' and '@n' are incompatible at line 19"


I tried removing the $ from answer but it didnt work it just threw up more errors at me. If you could look at it and check it out its appreciated.
Jonny_S
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 11th Feb 2004 20:59
Simple mistake what you need to do is enclose the n in speach marks so the code reads



If you declare yuor variable as a string then you have to assign your variable to a string, you do this by enclosing it in speach marks.

Hope that helped

If you dont understan when im saying try running these two examples and see if you can see the difference.

Example 1:



Example 2:



Supermonkey - The crime gifhting sex god monkey!
Jim T
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location:
Posted: 11th Feb 2004 21:14
ahh ok that was a simple mistake I can see where it was made now. Guess ill have to triple check next time.

thanks
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 11th Feb 2004 21:25
there is another mistake in your code, it contains a GOTO statement. If you are just starting out in programming I will pass on some advice NEVER USE GOTO. Use GOSUB-RETURN and then later learn about FUNCTION-ENDFUNCTION, but for now read up on gosub-return

trust me.

-RUST-
"What the... Mooooooooooo!"
Jonny_S
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 11th Feb 2004 21:42
Yeh I never even looked at that, I just immeadiatly spotted the Variable prob, but yes I prefer functions but alot of people use Gosubs

Supermonkey - The crime gifhting sex god monkey!
Jim T
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location:
Posted: 11th Feb 2004 21:49
Ok I read up on the GOSUB function and when I have
GOSUB-RETURN instead of GOTO I get
Quote: "could not understand command @ line 22"
ALso I am one that learns better from examples. So if that helps

Jonny_S
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 11th Feb 2004 21:54 Edited at: 11th Feb 2004 21:58
Ok You've missed the point slightly, no worries Ill show you whats wrong


should be



you then need a return at the end of the loop like so:



the whole code fixed and working is in the source box below

[edit] im logging off now so if you need any more help post here, if no-one posts right away ill be back on later for 10 mins to check my mail so I'll come and help you out then

Supermonkey - The crime gifhting sex god monkey!

Login to post a reply

Server time is: 2024-09-21 20:48:36
Your offset time is: 2024-09-21 20:48:36