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 / Debug help

Author
Message
Pbcrazy
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: ...pillow room...
Posted: 26th Nov 2008 20:10
Alright, i tried to make my first program in with DarkBasic, using CodeSurge. And i ran into a little debug problem, and i can't figure out what the heck it means.

error:
types "TEMP0" and "game" are in compatible at line 20

highlighted:
CurrDir$=CurrDir$+"/"+game(gnum)+"/"



can anyone tell me what is wrong?

thanks,
pb

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Nov 2008 20:32
Yup, your 'game' array hasn't been defined with a type, so it has defaulted to integer - you can't add an integer and a string.

Either renaming all 'game' to 'game$', or changing your dim to 'dim game() as string' should fix this problem.

Pbcrazy
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: ...pillow room...
Posted: 26th Nov 2008 20:35 Edited at: 26th Nov 2008 20:37
ahh ok, i wasnt sure if that was neccessary in DB, im used to VB but i thought maybe didnt have to do that, or it may not work, anyway thanks!

edit, now i have another error -_-

error:
cannot perform "integer" cast on type "FS@Loadinfo@s$" at line 27

highlighted:
bckgrdfile=s$

zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 26th Nov 2008 21:27 Edited at: 26th Nov 2008 21:35
Sort of the same reason. Your variable bckgrdfile is not of type string. Rather it is of type int. So change the following line...

global bckgrdfile

to

global bckgrdfile$

"When I look at that square... I wish FPSC noobs would stay on their side of the forums and stop polluting these boards." - Benjamin
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 29th Nov 2008 04:18 Edited at: 29th Nov 2008 04:18
It's always good to be explicit with your types otherwise you run into these problems all the time. So do this...


I'm not a real programmer but I play one with DBPro!

Login to post a reply

Server time is: 2024-09-27 22:34:31
Your offset time is: 2024-09-27 22:34:31