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 / Clearing Stuff Up...

Author
Message
iaretony
23
Years of Service
User Offline
Joined: 6th Jun 2003
Location:
Posted: 29th Jul 2003 00:26
Could an expert please let me know if I'm right about this:

1) You cannot pass TYPE's to functions.
2) You cannot pass arrays to functions.
3) All arrays are globally scoped.

I hope the DBPro team is working on adding 1 && 2, this would increase geometrically my ability to write good, reusable DBPro code!

Tony
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Jul 2003 00:52
1) Not true with update 5. You can now pass types (by value)
2) Correct currently.
3) Almost ... arrays created within functions are local unless you specify them global - and then they must already have been declared outside of the function.
ifman1
23
Years of Service
User Offline
Joined: 3rd Jul 2003
Location:
Posted: 29th Jul 2003 04:50
So what you're saying is that I can declare an array outside a function, use an array in a function and declare it as global and have the function update or alter the array?!? So in affect return an altered array? Or are all the changes to the array lost when the function exits? Heck, I'm going to go test this before you reply anyways....

ifman1
23
Years of Service
User Offline
Joined: 3rd Jul 2003
Location:
Posted: 29th Jul 2003 05:20
Oh yeah... Oh yeah... Can just totally alter a Globally defined UDT in a function and it is still changed when the function returns! Yeah!!!! Kick'n all that ass now!

Login to post a reply

Server time is: 2026-07-23 02:37:49
Your offset time is: 2026-07-23 02:37:49