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 / I don't get functionts yet.

Author
Message
Maati
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location:
Posted: 11th Jul 2009 11:06
Soo, I've been reading to tutorials and encountered functions. I thought I understood them a bit but when I tried using them DB turned off. Is there something bad with this code?

lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 11th Jul 2009 11:34
you need to explain yourself more, but i understand from your code..

you have to have the function at the end of the program, away from every other bit of code..

it is more preferable to put all your function in one file and just include it in the project...
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Jul 2009 12:30
The actual problem here seems to be that the function is entered before the main source, hence trying to execute the function without being called (the source code is read top-down), which won't work.
You'll probably get an error message like "Encountered function declaration in mid-program". Put it at the end of the source (after wait key in your code) and it should work

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Jul 2009 12:49
And put an END statement after the WAIT KEY to stop execution running into the function:


Maati
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location:
Posted: 11th Jul 2009 14:17
Thanks a lot!

Login to post a reply

Server time is: 2024-11-25 04:41:28
Your offset time is: 2024-11-25 04:41:28