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 / Global Parameters and Function calls

Author
Message
DarkBob
23
Years of Service
User Offline
Joined: 18th Apr 2003
Location:
Posted: 19th Apr 2003 01:23
I just got Dark Basic pro and I am having fun with globals when calling a function with a parameter.

I am passing a global varible to a function and not getting the right value, as far as I am concerned when I pass a parameter to a function its BY VALUE so I should be able to send a global and received the right value in my new local varible (myValue), but all I get is zero.

Anyone else getting this problem?

See code example...
DarkBob
23
Years of Service
User Offline
Joined: 18th Apr 2003
Location:
Posted: 19th Apr 2003 01:28
I just relised that its not when im calling a function from the main code area, its when Im calling a function from another function.

I think the problem is that the global values are not global at all, they are just visible in the main code block, other functions cannot see them.

DarkBob
23
Years of Service
User Offline
Joined: 18th Apr 2003
Location:
Posted: 19th Apr 2003 01:29
Sorted it out, just found the Global bit...sorry for the post...

Login to post a reply

Server time is: 2026-07-10 23:13:34
Your offset time is: 2026-07-10 23:13:34