Return parameters from a function - InfoPath Dev
in

InfoPath Dev

Return parameters from a function

Last post 04-23-2010 02:23 AM by alexia_net. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-23-2010 02:03 AM

    Return parameters from a function

    Hi. I am having a small problem in InfoPath 2007. I have writen a function to  calculate a value, but i cannot return it.

     

    Public Sub btnSaveNet_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)

    dim m_intSemFlag as integer

    dim m_strRasp as string

    m_intSemFlag = 0

    m_strRasp="1"

    Call SelectInUseNot(m_intSemFlag, m_strRasp)

    End Sub

            Public Sub SelectInUseNot(ByVal tmp_intSemFlag As Integer, ByVal tmp_strRasp As String)

                Select Case tmp_strRasp
                    Case "1"
                        m_strRasp = "Yes"
                    Case "2"
                        m_strRasp = "No"
                    Case ""
                        MessageBox.Show("Choose if the rack is in use or not.", "Information.", MessageBoxButtons.OK, MessageBoxIcon.Information)
                        tmp_intSemFlag = 1

                End Select

    m_strRasp variable should become 'Yes' after this but it does not. It stays "1". Why is that? Thank you!

  • 04-23-2010 02:14 AM In reply to

    Re: Return parameters from a function

    try passing ByRef instead of ByVal.

    ByRef passes reference of the variable so any changes done reflec, while as ByVal a copy of value is passed and a new variable is created in the function.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-23-2010 02:23 AM In reply to

    Re: Return parameters from a function

     Hi. Thank you. That did the trick.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.