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 / Function Problem...

Author
Message
Astucia
22
Years of Service
User Offline
Joined: 21st Dec 2002
Location: Mexico
Posted: 10th Feb 2003 06:58
Why the values within a function do not change when these are altered?
Please see the code.
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 10th Feb 2003 07:08
Variables are not "global" by default - a function is a contained area of code, variables within it are local to that function, the ones outside of it are hidden (unless passed it or made it global with the keyboard global infront of it).

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Astucia
22
Years of Service
User Offline
Joined: 21st Dec 2002
Location: Mexico
Posted: 10th Feb 2003 18:10
Ok, I want a Local Variable in a function an it not work like the past code, if you see the variables X,Y,Z in the Function XYZ() not change after a call function XYZ().
the cusetion here is: Can't I use a local Variable whit out make it global or Array, to use it in a Function?
Astucia
22
Years of Service
User Offline
Joined: 21st Dec 2002
Location: Mexico
Posted: 10th Feb 2003 18:14
Corection...
In the Past code in the XYZ() function the Local X,Y,Z Variables not change IN the Function!!!!

Login to post a reply

Server time is: 2025-05-18 13:22:48
Your offset time is: 2025-05-18 13:22:48