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.

Dark GDK / subroutines

Author
Message
Lord of the Games
19
Years of Service
User Offline
Joined: 27th May 2005
Location: Netherlands
Posted: 31st Jan 2006 01:17
Whats the best way to replace subroutines from darkBasic with? I tried functions, but the program seems to go in to an infinite loop. Please help.

Thx LOTG
Vlad
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 31st Jan 2006 09:29
Functions would be the way to go... can you post an example of your code please?

The only lazy people that can complete games are genius. You don't look like a genius, so you better stop being lazy.
Support your local Riker 9 Chapter.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 31st Jan 2006 10:14 Edited at: 31st Jan 2006 10:15
Functions are the only thing you've got, unless you want to start using lots of goto commands...

But no sensible person would would use that.

Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Smoke me a computer chip, I'll be baking breakfast.
Lord of the Games
19
Years of Service
User Offline
Joined: 27th May 2005
Location: Netherlands
Posted: 31st Jan 2006 10:44
I haven't got the code with me at the moment, but I was building a menu and the only way I knew to go to another page of it was a subroutine. Now I'm translating it to DSDK and it goes in to an infinite loop if i use a function in a function (both contain loopt to keep the screen refreshed). I'll post the code later.
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 31st Jan 2006 15:16
Hi Lord of the Games,

If you dont want to (or cant) use classes in c++, then I suggest that you use 1 main loop for your menu, in which different functions are called depending which menu shall be drawn.
something like this:

Furthermore you should define a struct for each function, where all important values of the menu that the user entered are stored, so that you can get the information from an other menu (either passing it over, or make the struct global).
Or at least define some global variables for that.

Remember, do only one Sync-loop, as I showed, and in the functions dont loop but return immediatly after having computed the users input and drawn the output.


In the End actually there are a lot of ways to organize a menu, but the best structured way would be with classes probably...

so long, hope this helps.

greets,
Barnski.

-- I just started with DarkSDK, by translating DBP Projects. --
Lord of the Games
19
Years of Service
User Offline
Joined: 27th May 2005
Location: Netherlands
Posted: 1st Feb 2006 00:29
Thx, I was just trying to edit my previous message, kept comming up with "Unknown System Error. Sorry but I have to abort now. Please try again later.". I'll try it right away. else Il post it anyway.
Lord of the Games
19
Years of Service
User Offline
Joined: 27th May 2005
Location: Netherlands
Posted: 1st Feb 2006 23:51 Edited at: 2nd Feb 2006 08:17
k, I'll probely start to become anoying, but I've switched from dbText to Sephnroth's AAText. Now I've included it and everything, but it wont compile. It give's a read @adress 0.000 when it tries to do something with g_pFont variable



I don't really understand DX, but it looks to me in the debugger the variable is totaly empty.



If anyone knows the answer...

Login to post a reply

Server time is: 2024-11-19 04:27:52
Your offset time is: 2024-11-19 04:27:52