Sign in to follow this  
Followers 0
grimta

Object Oriented AutoIt / Use same code several times.

3 posts in this topic

#1 ·  Posted

Hi everyone,

 

I know AutoIt is not Object Oriented, but maybe some one will know the way to work around it.

 

So, what is the situation, I have made a simple mailing application which will send proofs to the client by pressing the button:

I have tree button NEW, RENEW and REPLACEMENT, 

 

THE MAIN ISSUE is that I have a huge piece of code which is responsible to send appropriate proofs based on pre-defined variables.

What I'm looking for is that when I press NEW it will use variables_new and pass them to this code block and proofs will be sent, and when RENEW will use variables_renew which will be passed to the same block of code and will be executed again.

 

Currently I have to copy this mailing system code 3 times to make it work for three different buttons.

 

PS. Currently I'm using CASE to switch between buttons.
Any suggestions, ideas, way of doing, samples, will be appreciated.

 

Thank you.

 

 

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Move the code to a function that gets called with the appropriate parameter values.

Share this post


Link to post
Share on other sites

#3 ·  Posted

I would suggest posting your code, or at least a reproducer, rather than having us guess :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0