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 / Which order?

Author
Message
TillyLala
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location: In the little cupboard under the stairs
Posted: 31st Jul 2009 01:16
Hey, i'm a bit - very new to this! I started coding last week sometime and made an application that asks you your name, then it askes you if you like a random name and if you say yes it asks you if you like x colour, if you say no it says tough. Simple enough stuff and I think I understand it all - i just keep getting confused about which order things go in. Like strings and functions and where you should put them really confused me! I had to ask for help 'cause i'd try do it via the help files for DB pro and got it wrong! Is there a certain order things go in as a rule? Or is each application different?

Cheers,
TillyLala
cguy
16
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: In my Computer!
Posted: 31st Jul 2009 01:54
In order to get some help, you need to help us too. Give us what code you've got so far and maybe we can help you with the correct order and such. You must have worked on it a little!

Do we all have to put stupid jokes here?
TillyLala
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location: In the little cupboard under the stairs
Posted: 31st Jul 2009 02:05


My boyfriend had to help me a little cause i got confused towards the end hence the bits commented out. I figured if more than just him helped me I may get somewhere - You all seem like a friendly enough bunch
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 31st Jul 2009 02:16
Strings are anywhere you want them but dimentionalizing arrays should be at the top, followed by the main loop, and functions should always be last. Also right before the first function should be an END statement because Darkbasic produces an error if it sees a function.

TillyLala
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location: In the little cupboard under the stairs
Posted: 31st Jul 2009 22:11
Rrrright! There's sooo much stuff to get your head around! Thanks for the help. So, before any function you need an END statement yeah?
You could have the strings at the beginning, then the main loop the end statement, and then functions at the end? Is that right?

TillyLala
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 1st Aug 2009 10:52
Yeah, before the first function use END. Even if you'll never have an EXIT out of the main DO/LOOP it's always a good habit to put an END before the first function... any function after that doesn't need another END.

TillyLala
15
Years of Service
User Offline
Joined: 6th Jul 2009
Location: In the little cupboard under the stairs
Posted: 1st Aug 2009 23:51
Rrrright thanks! Think i've got it now.. I re jigged some stuff about and read some more tutorials and it's making a bit more sense.. I think!

Cheers,
TillyLala

Login to post a reply

Server time is: 2024-09-28 08:29:55
Your offset time is: 2024-09-28 08:29:55