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 / Reference Parameters?

Author
Message
Black Hydra
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 16th Nov 2003 20:29
I had to ask. Can you use reference parameters in functions like C++. I am assuming you can't but anymore tools than I already have would be helpful.

Because if you can't then functions can only pass in and out one piece of data somewhat limiting there usefulness. The fact that subroutines will have to handle anything that requires two or more data pieces is a bit annoying.

So can you?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Nov 2003 22:38
'fraid not - we have been asking for it though
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 16th Nov 2003 22:41
arrays are global , they hold their values inside or outside functions, so you can pass more than one value, also you could load a memblock or the clipboard with the values you want to pass, maybe even a user defined type (but not tried that...don`t take my word for it) you just have get inventive, (messy coders like me scorn structure anyway ).

Mentor.
Black Hydra
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 17th Nov 2003 00:48
I like avoiding excessive use of arrays. I always invision making them like slating stuff in stone. I don't really like using arrays indiscriminately.

Can't you use the GLOBAL command to make the variable global?

As for memblocks, it seems a bit complex for a simple problem. I'd rather just use some subroutines if necessary.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Nov 2003 09:04
Yes, you can set a variable as global (if it is outside a function). You can use this to pass back types (as you can't currently return them from functions)

Login to post a reply

Server time is: 2024-09-21 09:31:18
Your offset time is: 2024-09-21 09:31:18