0

hello everyone,

I am working on a little program (game) is called Pig latin. I created a sub procedure and I passed the word to be converted by value and the piglatin word byref.

Now when I call the procedure in the button click event I get the wavy green line under the variable passed by reference but the program works ok.
Call Convert_to_Pig_Latin(strOriginalWord, strPigLatin)
The error message when I hover my mouse over the green line says " Variable 'strPigLatin' is passed by reference before it has been assigned a value. A null reference exception could result at runtime."

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim strOriginalWord As String
        Dim strPigLatin As String

        
        strOriginalWord = TextBox1.Text.Trim


        Call Convert_to_Pig_Latin(strOriginalWord, strPigLatin)

        Label1.Text = strPigLatin
end sub

I need to get ride of the wavy green line please help.

Regards

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by GeekByChoiCe
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.