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 / Problems with functions... i think.

Author
Message
nodeg
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location:
Posted: 6th Jun 2004 04:46
This program started out as simply showing a circle wherever the mouse is. I created an array, and a function that should initialise all the elements of that array to 0. For some reason, the program won't run now. Help!
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 6th Jun 2004 04:59
Hmm...

According to my playing with the editor and all, I was under the impression that functions belonged at the END of a program, rather than the beginning. The thinking was, at least in my mind at the time I encounted the error "Function Encountered" was that the Dark Basic tried to run from the top downward, and in finding a function it declared that point the end of the main loop.

Try moving the function definition and see if that solves your problem...

Any truly great code should be indisguishable from magic.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Jun 2004 05:51 Edited at: 6th Jun 2004 05:52
yes, dbp code is procedural, meaning it starts at first line and goes thru until last line. your function, where it is is mucking it all up. put the function after the do-loop and place the function call insid ethe loop, and it should be ok


* DBP_NETLIB_v1.2 - NOW WITH VARIABLE WATCHER! * Click Logo
nodeg
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location:
Posted: 6th Jun 2004 09:14
Thanks guys. My C++ background made me want to prototype, and when I didn't have to do that it seemed logical to place the function first.

Login to post a reply

Server time is: 2024-09-22 12:42:51
Your offset time is: 2024-09-22 12:42:51