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.

Author
Message
Squark
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United Kingdom
Posted: 27th Nov 2002 16:40
How can you create a user defined type and then pass it as a parameter into a function. EG.



I have tried all sorts of ways but i cant get the function to return 300 which it should. Can anyone help me?

Thanks.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 27th Nov 2002 17:01
If I remember correctly, you can't pass UDT's to functions (which needs solving).

And at the moment, there could be a problem accessing global UDT's from functions.

Good news everybody! I really am THAT good...
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 27th Nov 2002 17:04
And return is a reserved keyword by the way

Good news everybody! I really am THAT good...
Aith
21
Years of Service
User Offline
Joined: 21st Oct 2002
Location:
Posted: 27th Nov 2002 17:13
Yeah, MrTAToad is right. You can't pass UDT's into functions. However, UDT's are global so you should be able to manipulate them inside a function, you just can't pass them into a function or return them.

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 27th Nov 2002 17:22
There seems to be a problem modifying them in a function too..

Good news everybody! I really am THAT good...
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 27th Nov 2002 17:42
use an array and it also helps to manage media numbers by storing it in a name(int).NUM





MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 27th Nov 2002 17:56
yes, but you cant seem to reliably do anything with types in functions.

Good news everybody! I really am THAT good...
ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 27th Nov 2002 18:33
Has anybody addressed this? I'm at work and I left my disk at home, so I can't go back to patch 2 till I get home which means I actually have to work now. Dammit! I'm going to be productive at my job and it's all your fault!

ZomBfied
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 27th Nov 2002 18:34


Squark
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United Kingdom
Posted: 28th Nov 2002 21:48
I knew you could not do this in the original but in the version 2 patch log it said under usage limitations that it was not possible to pass UDT to functions however in the version 3 log it dosent say you cant so i assumed that you now can.

Login to post a reply

Server time is: 2024-05-04 02:28:13
Your offset time is: 2024-05-04 02:28:13