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 / User Types as Function Parameters?

Author
Message
Whopper
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 2nd Oct 2003 06:14
Hello,

Could someone let me know whether its possible to pass User TYPES as function parameters please?

This is obviously a very fundamental feature requirement to do any kind of well structured code, but I seem to be having a lot of strange errors when i try to do it...

If it is possible, could you provide a small example that works to light the way?

Also, are there any issues with doing this from included files?

Thanks in advance.
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 2nd Oct 2003 07:01 Edited at: 2nd Oct 2003 07:06
I guess it would work. It should, if there's not a bug.

Lets see...


Yep, works fine for me. Is that what you mean by "pass User TYPES as function parameters"?

P.S. The wrong second text diplayed is not a bug with DBP.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_why_floating_point_numbers_may_lose_precision.asp

"All programmers are playwrites and all computers are lousy actors" -Anon
Whopper
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 2nd Oct 2003 07:10
No, sorry, I probably wasn't clear. What I mean't was to pass the whole type as one parameter.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 2nd Oct 2003 07:30


until the ability is put in to pass back types it seems a little on the limited side

Whopper
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 2nd Oct 2003 08:06
curiously, if i make the following small addition, it fails to complie..



Am I doing something daft here?
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 2nd Oct 2003 08:13
perhaps... probably the multiplying by 0

Whopper
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 3rd Oct 2003 06:42
I don't understand...

Why doesn't it compile?
Whopper
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 4th Oct 2003 18:14
Shameless Bump.

Can anyone help with this? I'm on the verge of giving up.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 4th Oct 2003 21:40
ask Lee ... he'll know

skovron
22
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 4th Oct 2003 22:46
Yeah I've got the same problem for some time.

Parameter for "function name" do not match "type name" in program
or something. I've no idea what's going on

Login to post a reply

Server time is: 2026-07-25 07:01:44
Your offset time is: 2026-07-25 07:01:44