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 / passing user defined types to functions

Author
Message
Xsniper
21
Years of Service
User Offline
Joined: 29th Dec 2002
Location:
Posted: 30th Dec 2002 20:12
I've made my own user defined type and have been trying to pass a variable made of that type into a function but have had no luck. My code looks something like this:

TYPE mytype
somevar as integer
ENDTYPE

FUNCTION myfunc(tType as mytype)
tType.somevar = 0
ENDFUNCTION

rem Some subroutine calling myfunc
_somesub:
tvar as mytype
myfunc(tvar)
return
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Dec 2002 20:49
You've had no luck because DBPro can't do this yet. I believe (or hope!) that it's on the cards for a later patch.
Xsniper
21
Years of Service
User Offline
Joined: 29th Dec 2002
Location:
Posted: 30th Dec 2002 20:52
Ah ok, well that explains why. ^_^ I suppose I'll do it the long way now and make it more efficient once dbp gets support for it.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Dec 2002 20:55
You can work around it for now by creating an array of your type, and passing around the index into the array instead.

Login to post a reply

Server time is: 2024-11-23 19:55:26
Your offset time is: 2024-11-23 19:55:26