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 / Need help with empty functions

Author
Message
Jerbo
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location:
Posted: 20th Jun 2004 23:30
This is a very basic question, as I am a beginner. I am using darkbasic pro. I want to break my current program up into functions, but I have no need to pass any arguements or have a return value. Yet everytime I program a function I get an error(example below). Can anyone please help me?

Function call: Create_Deck()

Function body: function Create_Deck

End Function

With or without the braces in the function call or body, I get this same error everytime: "Parameter mismatch in command end" <-----------referring to the function end statement
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 20th Jun 2004 23:34
Take out the space in "End function" It should be endfunction.
Cheers

Jerbo
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location:
Posted: 20th Jun 2004 23:37
I feel a little dumb. Thanks alot. Very simple solution.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 20th Jun 2004 23:48
Don't feel dumb we have all been there.

I originally thought I had to type the fucntion name after the endfuction. for example:

endfunction createdeck()

from what I can remember it would compile without error. What problems it could cause, scares me.

------
Even now I can't tell you how many times my game logic is off, or compiler errors I've received, by typing:

end if

rather than

endif


Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Jun 2004 00:08 Edited at: 21st Jun 2004 00:11
I always put

control camera using arrow keys

instead of

control camera using arrowkeys

EVERY time I do that (I write a lot of examples for people and it`s a easy way to look around the scene)


Mentor.


ps : you should put the brackets after the function definition as well , eg:

function create deck()

or you might get weirdness creeping into your code .

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.

Login to post a reply

Server time is: 2024-09-22 14:12:41
Your offset time is: 2024-09-22 14:12:41