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
Viper
23
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 12th Jun 2003 11:50
I seem to be having strange problems with passing perameters between
functions. even with using global variables and error occurs.
This is basically the format:




Do I just not see anything or am I going it at the wrong way all
together?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jun 2003 13:05
Function arguments are passed by *value*. ie, they are copies of the original value. So, changing their value only changes the local copy.

If you want to change a global, change it directly:

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 12th Jun 2003 13:06
erm... you create an integer you don't give it a value you then pass it to another value that does nothing...

what exactly do you expect to happen?

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 12th Jun 2003 18:00
You can use pointers though.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Jun 2003 19:35
But not in functions, or has that been fixed ?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jun 2003 22:03
Yep. I use them all the time:



... and before you say it, yes, I know we've already got these in a plugin - I'm just proving the point . Interestingly though, these are just as fast as the plugin versions.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Jun 2003 22:08 Edited at: 12th Jun 2003 22:09
Really - I would have expected the C code to be slightly quicker (due to the need for less type checking etc).

Must admit, I haven't done any speed checking at all - I was going on knowledge of previous BASIC's & other languages.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jun 2003 22:57
DBPro does its type checking at compile time, like C does, so there is no performance hit there.

The whole function in either language (excluding the stack stuff) just boils down to something like this:



... except that I think DBPro uses the 'bl' register instead. There's not much room there for a C optimiser to speed things up
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Jun 2003 12:19
Logical really - should be able to get pretty near C speeds then.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2026-07-20 09:33:09
Your offset time is: 2026-07-20 09:33:09