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.

DarkBASIC Professional Discussion / Can you create a function inside a user defined type?

Author
Message
superman3275
13
Years of Service
User Offline
Joined: 8th Feb 2013
Location:
Posted: 8th Feb 2013 21:26
I'm coming to DarkBASIC from an extensive C++ Graphics Programming background, and was wondering:
Could I create a function inside a user defined type?

As an example:


The distance function would find the distance between one point and another. (I know this is bad class design, I'm simply bad at examples ).

If it is possible, what is the syntax for defining the function and parameters?

Cheers !

I can program in C++ and SFML 2.0, JavaScript, HTML5 / CSS3, and DarkBASIC Professional! Fear Me !
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 9th Feb 2013 17:03
no, UDTs in DBPro are data structures only, you cant add methods/functions/etc

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Feb 2013 17:09
And to boost, arrays are also not supported with UDTs. :/

TheComet

http://blankflankstudios.tumblr.com/
"ZIP files are such a retarded format!" - Phaelax
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 9th Feb 2013 17:24
aye

Login to post a reply

Server time is: 2026-07-07 14:23:41
Your offset time is: 2026-07-07 14:23:41