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 / whats wrong with this line of code?

Author
Message
kfoong
21
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 16th Mar 2003 03:00
function distbetween(dbobj#(1), dbobj#(2))

ive already called the arrays before hand. When i compile it, it says]

Function declaration has unknown parameter
--------
http://www.stellarblue.vze.com/
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 16th Mar 2003 03:55
the arrays cannot be fed into the function through the parameters. They just work inside if declared as global which is at the top of main,

kfoong
21
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 16th Mar 2003 10:57
well thats just cheap.

--------
http://www.stellarblue.vze.com/
aw2050
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 16th Mar 2003 12:57
Im guessing here, but in Qbasic and VB, you dont put the Ubound of the array in when declaring a function. You would say:

function distbetween(obj1, obj2)
.
.
.
end function

and when calling the function, you would then put the index in:

answer = distbetween(dobj#(1),dobj#(2))

this is so that functions will work with any data you send to them, which can be useful!
aw2050

Login to post a reply

Server time is: 2024-11-12 23:54:50
Your offset time is: 2024-11-12 23:54:50