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 / Sending and getting data from functions

Author
Message
Timber
19
Years of Service
User Offline
Joined: 27th Nov 2004
Location:
Posted: 27th Nov 2004 21:45
How do you send or return a structure such as a user type to and from a function. Am I limited to creating globals to get complex data handled in a function or muust I use gosubs?

I'm finding it a real pain, also why do I have to keep retyping the user type name in a routine for every variable in the type. Other packages use "with" ie. "with userType do" then every variable of that type refers to it.
Eg with fred do
name$="Fred"
age=64
tel=123056
end block
Any help is appreciated.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Nov 2004 22:06
Types can't be passed into or out of functions, I think.

I'm usually dealing with arrays when I have types to I just do this:



There is no 'with' function in DBPro

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Timber
19
Years of Service
User Offline
Joined: 27th Nov 2004
Location:
Posted: 28th Nov 2004 05:48
Thanks. As I assumed, no 'with' statement. As you suggest I have been using the array / index method to use "user types" in functions. I was hoping there was a method not mentioned in the rather sparse manual. Just a beginer so still a lot to learn. (Using DBPro) Normally programme in Delphi 7.

Login to post a reply

Server time is: 2024-11-13 18:44:28
Your offset time is: 2024-11-13 18:44:28