Values aren't being returned in Sub-Procedure

I have a two subroutines where one calls the other and passes 2 parameters, however, on return, the parameters are empty and I'm not sure what I'm doing wrong.

Here are the two Sub Routines:

    Private Sub usrResistanceCreep_ResistanceButton() Handles usrResistanceCreep.ResistanceButton
        'Debug.Print("usrResistanceCreep_ResistanceButton")

        Try
            Dim strRin As String = String.Empty
            Dim strRout As String = String.Empty

            EH.ErrorMessage = String.Empty

            CheckTestRinRout(strRin, strRout)

            If strRin.Length > 0 Then
                usrResistanceCreep.txtRIn.Text = Format(CDec(strRin), "#####0.####")
            End If

            If strRout.Length > 0 Then
                usrResistanceCreep.txtROut.Text = Format(CDec(strRout), "#####0.####")
            End If

        Catch ex As Exception
            EH.ErrorMessage = "frmCalibration_3/usrResistanceCreep_ResistanceButton() - " & ex.Message & "...Contact Engineering!" & "~E"
        End Try

        EH.ProcessMessages(Me, sbr, EH.ErrorMessage)
    End Sub
    '
    '
    '
    Public Sub CheckTestRinRout(ByVal strRIn As String, ByVal strROut As String)
        'Debug.Print("CheckTestRinRout")

        Try
            EH.ErrorMessage = String.Empty

            strMessage = "Acquiring Resistance In / Resistance Out values!"
            mlStatusMessage.Text = strMessage

            strRIn = String.Empty
            strRout = String.Empty

            Application.DoEvents()

            InitializeErrorClass(EH)
            ReadRin(RealReadMode, 0, EH)
            If EH.ErrorMessage = String.Empty Then
                strRIn = CStr(GetDecimalPlaces(CStr(EH.sSingle), gLoadDecimalPlaces))
            Else
                GoTo ProcessMessage
            End If

            If blnGetRout Then
                blnGetRout = False

                ReadRout(RealReadMode, 0, EH)

                If EH.ErrorMessage = String.Empty Then
                    strRout = CStr(GetDecimalPlaces(CStr(EH.sSingle), gLoadDecimalPlaces))
                End If
            End If

            If strRIn.Length > 0 And strRout.Length > 0 Then
                blnResiTestComplete = True

                If AreTestsComplete2() Then
                    btnSaveTestLoad.Focus()
                End If
            End If

            mlStatusMessage.Text = String.Empty

ProcessMessage:

        Catch ex As Exception
            EH.ErrorMessage = "frmCalibration_3/CheckTestRinRout() - " & ex.Message & "...Contact Engineering!" & "~E"
        End Try
    End Sub

Open in new window

BlakeMcKennaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

ElrondCTCommented:
In Public Sub CheckTestRinRout(ByVal strRIn As String, ByVal strROut As String), change both ByVal to ByRef.

ByVal makes a copy of the data that you're passing, and leaves the original values unchanged. ByRef points to the original variable, so any change is passed to the calling procedure.
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
BlakeMcKennaAuthor Commented:
ElronCT, that worked great! I've used ByRef before but wasn't sure if that would take care of it. I should have tried it before posting!

Thank you!
0
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.