tommyt11
Member
I thought I posted this but apparently didn't take
I have a win form app I am building.
Initially I build a variable string from following code and need to pass it to next function which sends to dll and on to server. My problem is I create the string its there but I lose it before I can pass it to next function. So apparently I'm either creating wrong and not holding it or somewhere i'm dropping it in the code. Please help
Here is code to both Functions.
I have a win form app I am building.
Initially I build a variable string from following code and need to pass it to next function which sends to dll and on to server. My problem is I create the string its there but I lose it before I can pass it to next function. So apparently I'm either creating wrong and not holding it or somewhere i'm dropping it in the code. Please help
Here is code to both Functions.
Function MyFunc(ByVal Variable1 As String) As Object On Error Resume Next Dim appData As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ' Checks if Local file exists and then creates string (Variable1) from correct parameters If My.Computer.FileSystem.FileExists(appData & "\[path]\MyFile.txt") = True Then 'This reads file (appData & "\[path]\MyFile.txt") And creates object Dim line As String = System.IO.File.ReadLines(appData & "\[path]\MyFile.txt").First Dim fields() As String = line.Split(",".ToCharArray()) Dim Task = "GetID" Dim Text1 = fields(0) Main.Text1.Text = fields(0) Variable1 = (Text1 + "," + Const1 + "," + Const2 + "," + Const3) MessageBox.Show(Variable1, "Yo it worked")'trace 'This should create a representation of object for server (Variable1) Else Dim Text2 = Main.Text2.Text Variable1 = (Text2 + "," + Const1 + "," + Const2 + "," + Const3) MessageBox.Show(Variable1, "Yo it worked")'trace End If 'Test it to see if got it If Variable1 = "" Then MsgBox("Don't got it") Else MsgBox("I'm calling NextFunctioin CCM") 'Send to CCM Return Variable1 End If Return Variable1.ToString MsgBox(Variable1,, "how bout here") ' I have string until here then it vanishes. End Function ' NOT Working 160127 6:55 am Function ProgramStarts(ByVal Variable2 As String, ByVal Variable1 As Object) As Object On Error Resume Next Variable1.ToString MsgBox(Variable1)' this gets Nothing Variable2 = Variable1 ' so I don't get it here MsgBox(Variable2,, "darn")' or here 'This will make call to DLL once completed 'Start New Code to go directly to server from form submit End Function
Last edited by a moderator: