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 / New and need some help with DB Pro

Author
Message
ssgtsgt
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: Texas
Posted: 25th Jun 2004 21:30
Hi all I reacently got the darkbasic professional trial to see if I liked it enough to purchase. I was working through the huge dungeon tutorial and I have a problem with the code that I can not figure out. The error I am getting from typing in the code is: Parameters for Int do not match value at line 106.

I have checked and doulbe checked my typing and the code listed in the pdf file.

line 106 which is highlighted:

if map$=(int(curposx),int(curposz))="#" or

Any information would be appreciated
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 25th Jun 2004 22:04 Edited at: 25th Jun 2004 22:07
I don't have the Dungeon Tuorial in front of me, nor am I familiar with it. But I would assume the code is suppose to be

if map$(int(curposx),int(cursposz))="#" or

the two equals signs in the line you posted surely would cause an error. I believe that the code must set up a 2-dimensional array called map$. Dim map$(xsize,ysize). It then probably reads in map data. In the line you posted it's probably tring to check and compare the characters <current position> with the maps data.

Hence, If map$(xpos,zpos)="#" or
where: xpos=int(curposx)
zpos=int(curzpos)

You cut off the rest of the line so I don't know what the or condition contains.

~zen


Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Jun 2004 22:10
that line doesn`t make sense, try

if map$="#"

looks like a typo or something corrupted in the pdf, it could also be

if map$(int(curposx(),int(curposy())="#"

but a line like you show doesn`t make sense to man nor machine, these I posted are just guesses, do they have any finished example of the code you could check it against?

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.
ssgtsgt
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: Texas
Posted: 25th Jun 2004 22:12
That was it...the first equal sign.

Thank you very much
ssgtsgt
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: Texas
Posted: 25th Jun 2004 22:30
I changed it to if map$(int(curposx),int(curposz))="#" or
and it moved along

now i get this error: could not determine parameter type of "#" at line 106

again this is how it is listed in the pdf. From what I understand the program is using the map$ array to read in characters and this first one we are checking for the # character
so i am kind of lost on why i'm being told it can not determine the parameter type of "#"
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 25th Jun 2004 23:02
First make sure that you closed of the parenthesis. Try using a space between the = and the last parenthesis and a space between = and the quotaion mark. For some reason it looks like it believes it's a third paramater in map$(x,z,="#")?? which would cause an error like that. I'll try to look at the dungeon tuturial to see if I can spot what is going on. In th meantime make sure that line that dims the array is correct should be something like

dim map$(xsize,zsize)

I'll post back if I can find something.

~zen


ssgtsgt
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: Texas
Posted: 25th Jun 2004 23:23
Thanks I would appreciate it. I have tried it with a space afer the last paranthesis and with a space after the equal sign with the same error.

My dim statement for map$:

mapsize=512
dim map$(mapsize,mapsize)
(as it is written in the pdf)
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 25th Jun 2004 23:36 Edited at: 26th Jun 2004 00:52
I looked at the tutorial and the code looks ok.
What happens if you use & compile the source that comes with the zip download instead of typing it yourself from the .pdf. Does it work then? There must be something that is still wrong somewhere. I can't test from my location, but I will try to compile the demo tonight if your still having this issue.

~zen


Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Jun 2004 23:45
it could be an error on the following or previous line, one error can spill over to another instruction sometimes, it depends on what the compiler thinks it is reading as against what it actualy is reading, try remming out lines (just put "rem" and a space at the start) and see if that allows the compiler to move on, also beware catching the "." key when you meant to type ",", the difference doesn`t show up that well in the editor sometimes and you can`t see the problem for looking so to speak.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.
ssgtsgt
20
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: Texas
Posted: 26th Jun 2004 00:13
hmmm I did as you suggested and compiled the source code that came with the tutorial and it worked fine

so the problem must be a typing error i made somewhere else in the code?

Thanks for the suggestion i will start comparing the tutorial source code to my own typing

Login to post a reply

Server time is: 2024-09-22 14:28:39
Your offset time is: 2024-09-22 14:28:39