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 / DB (not pro) help please on a function...

Author
Message
Phil the Dill
18
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 29th May 2006 15:22
What i am trying to achieve is to make an array local such that every time the function is called, it dimensions a new array. In this program it stores the value 2 into an array then it calls itself again and stores 3 into an array. It prints this value then returns back because the function finishes. Then it prints the array from the first calling. This should be 2 but it says 3. This means that the array isn't truly local because it always takes the same value as long as it's in the function and doesn't matter if you've called it again or not. Is there a way of making it truly local or do I have to try something else? Also, how do you make a variable (not array) global?




Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 29th May 2006 17:35
I use DBPro, but I think it will be the same in DBC.

To make a variable global put this at the beginning of your program



replacing the word variable with the name of the variable you want to be global.

Insanity is just a state of mind
Phil the Dill
18
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 30th May 2006 01:12
I tried that except it said it was an unrecognized command...Is there any other way that might be right for DBC?
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 2nd Jun 2006 21:13
Arrays are always global.

Sadly, that is the beginning and end of the matter, as far as I know.

I've taken DBC off my machine after getting pro, but I'm fairly certain that Global should work?? Can't help you there, I'm afraid.
Phil the Dill
18
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 4th Jun 2006 09:44
I've tried quite a few times and looked it up on the help files etc but it didn't work as I said above.

About the arrays, would there be a way to simulate a local array apart from adding an extra dimension and calling it the first hello array and second hello array etc...?

Login to post a reply

Server time is: 2024-11-26 19:59:35
Your offset time is: 2024-11-26 19:59:35