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 / Types into functions

Author
Message
Mnemonix
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 3rd Apr 2003 03:32
Can i pass a user defined type as an argument into a function. If so can i return a user defined type from a function. Thnx in advance
Where did his Ak-47 go.
Darth Coder
23
Years of Service
User Offline
Joined: 30th Mar 2003
Location: Switzerland
Posted: 3rd Apr 2003 03:38
No, that's not possible

If you're using patch 4 you can access array of types (declared outside the function, there are global really). With earlier versions or demo, don't try that there is a bug.

"You don't know the power of the Dark Side." - Darth Vader
Mnemonix
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 3rd Apr 2003 03:56
Geez ty Darth Coder. I forgot about arrays being global and all. Now im getting a cannot find structure warning. This isnt working. Cannot find structure. And then the program runs but not as i want it to.

Where did his Ak-47 go.
Mnemonix
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 3rd Apr 2003 03:58
Aha, i always discover the problem as soon as i post to complain about it. I declared a type with the same name as a function and it must have been conflicting somehow. I changed the name and got no warning and the program ran optimumly

Where did his Ak-47 go.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 3rd Apr 2003 07:27
use a pointer and pass them that way, or global the data its easier

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Darth Coder
23
Years of Service
User Offline
Joined: 30th Mar 2003
Location: Switzerland
Posted: 3rd Apr 2003 16:31
You can't currently pass them as pointers. DBP pointers are too limited for that

"You don't know the power of the Dark Side." - Darth Vader

Login to post a reply

Server time is: 2026-07-10 20:57:04
Your offset time is: 2026-07-10 20:57:04