Passing a Procedure after creating a procedure

After creating an average function procedure that takes a decimal and return the results as a string how do I create another procedure that passes the decimal back to the average function
thimss2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CJ_SCommented:
You pass a decimal to average, and you need to pass the decimal back to average? Could you clarify what you want?
0
thimss2Author Commented:
I have created this functionn:
Public Function AWage(ByVal dWages as Decimal, By Val nEmpls as Integer) as String

Dim dWages as Decimal
Dim nEmpls as Integer


Return CStr(dWages/nEmpls)
End Function


Now I need to create a procedure that takes a decimal and integer and passes them to the Average function above

Thanks
0
CJ_SCommented:
Public Sub Average(ByVal dWages as Decimal, By Val nEmpls as Integer)
  AWage(dWages, nEmpls)
End Sub

?

0
thimss2Author Commented:
Re: I need to create a procedure that takes a decimal and integer and passes them to the Average function above
This is what I have come up with on my own.  I need some Feedback.

' called procedure which decides the passing mechanism
Sub DisplayInfo(AWage as string)
  Messagebox.Show(AWage)
End Sub

'calling procedure which passes the data into the average function above(AWage)
Sub avg1(dWages, nEmpls) Handles Button.Click1
  Dim V as string
  V= CSTR(dWages/ nEmpls)
DisplayInfo(V)
End Sub


0
CJ_SCommented:
Mm, you are a beginner :-)

I assume that you have a Button instance, and you would like the Average function to be called after a button has been pressed. Try it like:

Protected WithEVents Button1 as Button

' called procedure which decides the passing mechanism
Sub DisplayInfo(ByVal AWage as string)
  Messagebox.Show(AWage)
End Sub

'calling procedure which passes the data into the average function above(AWage)
Public Function Average(ByVal dWages as Decimal , ByVal nEmpls as ) as String
  Return (dWages/ nEmpls).ToString()
End Function

Private Sub Button1_OnClick(sender as Object, e as EventArgs) Handles Button1.Click
  DisplayInfo(Average(1.2, 4))
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.