Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Private Sub btnCalibrate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalibrate.Click


           Dim CalibFile As FileStream
           CalibFile = New FileStream("Calibration.ini", FileMode.Create)
           Dim i As Integer
           Dim byteArray() As Byte
           Dim dataString As String

           For i = 0 To lstHSL.Items.Count() - 1
               dataString = dataString + lstHSL.Items(i)
           Next i

           byteArray = Encoding.Unicode.GetBytes(dataString)  'This is the problematic part

           CalibFile.Write(byteArray, 0, byteArray.Length)
           CalibFile.Close()
           CalibFile = Nothing


       End Sub

 

"String reference is not set to an instance of a string"

"Everything should be made as simple as possible, but not simpler."

"It's not that I'm so smart , it's just that I stay with problems longer ."

- Albert Einstein

Posted
I have allways thought & is same as + ? ...anyway I tried '&' with the same result... I got same error... have to investigate whats going on...

"Everything should be made as simple as possible, but not simpler."

"It's not that I'm so smart , it's just that I stay with problems longer ."

- Albert Einstein

  • Administrators
Posted

Is the dataString building up in the loop though? What is the value of lstHSL.Items.Count? Try putting Option Strict On at the top of the source file and fix any errors that get generated.

Also what does lstHSL(i) evaluate to in each itteration of the loop?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

ROFL, a good point actually I didn't have anytihng in the listbox :DDDD

 

 

*Bangs his head on the wall*

*Bangs his head on the wall*

*Bangs his head on the wall*

*Bangs his head on the wall*

*Bangs his head on the wall*

"Everything should be made as simple as possible, but not simpler."

"It's not that I'm so smart , it's just that I stay with problems longer ."

- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...