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 / function question

Author
Message
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 12th Aug 2007 08:14
lets say i make a weapon (makeweapon(attack#,name$,model$)) and i do not use the name$ variable at all... is it still used? would it still be declared?
thanks,
wicked

Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 12th Aug 2007 08:25 Edited at: 12th Aug 2007 08:26
use types, yes the name$ would still be declared.




http://www.freewebs.com/zornoxstudios/
Learning C++ thanks DGDK
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 12th Aug 2007 09:24
what makes types so special?

Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 12th Aug 2007 12:36
They make things more flexible and readable. If you uses arrarys for weapons, and the weapons have three charateristics, where are some ways to do that. Here are the three I can think of:
Three arrays:

One multidimensional array:

One array with UDT:


UDT's (or User Defined Types) is very good when coding weapon systems, player systems, powerup systems... well, they are one of the things that really makes your day as a programmer.

Login to post a reply

Server time is: 2024-11-26 11:30:23
Your offset time is: 2024-11-26 11:30:23