change variable value via hook code?

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
mopensoft
Posts: 146
Joined: Tue Dec 04, 2012 3:33 pm
Location: Melbourne, Australia
Contact:

change variable value via hook code?

Post by mopensoft »

Is there a way to update value of a variable via HookAddCode? For example
- I have hook Plugins.HookAddCode(null, "FormPayment.Load_update", CurPat, text);
- I change "text" value inside hook code

Is there anyway I can retrieve new value of "text" variable? Or may be get the hook return values other than Boolean?

Thanks
allends
Posts: 244
Joined: Fri Aug 23, 2013 11:29 am

Re: change variable value via hook code?

Post by allends »

http://opendental.com/manual/patternplugins.html
Parameters
...
For parameters that are value types and for strings, if a user wishes the changed value to persist after the hook is run, then we will need to follow this pattern:

Code: Select all

object[] parameters={myInt,myStr};
Plugins.HookAddCode(this,"FormClaim.GetClaims_beginning", parameters);        
myInt=(int)parameters[0];
myStr=(string)parameters[1];
Allen
Open Dental Software
http://www.opendental.com
User avatar
mopensoft
Posts: 146
Joined: Tue Dec 04, 2012 3:33 pm
Location: Melbourne, Australia
Contact:

Re: change variable value via hook code?

Post by mopensoft »

Thanks for your help. Can you add an other hook in this thread (last post): viewtopic.php?f=3&t=5884#p25715
Post Reply