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 / Basic Syntex Questions

Author
Message
Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 13th Oct 2008 05:27
What I am trying to do:
- Create MyButton
- Set MyButton.X# in the function and have the value retain when I try this: message str$(MyButton.X#)
- It won't so I try this: MyButton = Create_Button(MyButton).
- That doesn't work so I tried what I posted below.



This is a big draw back in DB Pro!

Thanks for your help!

Dark Fire
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Oct 2008 15:45
When you call a function with a parameter, a copy is passed, not the original. Whatever changes you make to the copy are discarded when the function returns.

You'll need to use a global or an array instead.

Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 13th Oct 2008 16:31
@IanM - I kinda figured that was what I needed to do. I will look into creating a plugin to address this problem.

Thanks,

Dark Fire

Login to post a reply

Server time is: 2024-09-27 20:20:21
Your offset time is: 2024-09-27 20:20:21