Conversion from string "" to type 'Integer' is not valid-VBForums
Results 1 to 5 of 5

Thread: Conversion from string "" to type 'Integer' is not valid

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    3

    Conversion from string "" to type 'Integer' is not valid

    i,am new user in VB and just start to programming and when i debug then pop up "Conversion from string "" to type 'Integer' is not valid" it always pop up when i press a the button 2 as write file

    the cooding

    [spoiler]Public Class Form1
    Private FilePath As String = Nothing



    Public Sub WriteFile(ByVal FilePath As String)
    Dim Writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Big)

    Writer.Position = &H2C857 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox6.Text)

    Writer.Position = &H2C85F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox7.Text)

    Writer.Position = &H2C867 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox4.Text)

    Writer.Position = &H2C86B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox5.Text)

    Writer.Position = &H2C86F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox5.Text)

    Writer.Position = &H2C873 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox2.Text)

    Writer.Position = &H2C87F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox3.Text)

    Writer.Position = &H2C883 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox1.Text)

    Writer.Position = &H2C887 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox10.Text)

    Writer.Position = &H2C88B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox9.Text)

    Writer.Position = &H2C88F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox8.Text)

    Writer.Position = &H2C893 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox11.Text)

    Writer.Position = &H2CC53 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox12.Text)

    Writer.Position = &H2CC5B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox13.Text)

    Writer.Position = &H2CC63 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox14.Text)

    Writer.Position = &H2CC67 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox15.Text)

    Writer.Position = &H2CC6B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox15.Text)

    Writer.Position = &H2CC6F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox16.Text)

    Writer.Position = &H2CC7B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox17.Text)

    Writer.Position = &H2CC7F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox18.Text)

    Writer.Position = &H2CC83 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox19.Text)

    Writer.Position = &H2CC87 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox20.Text)

    Writer.Position = &H2CC8B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox21.Text)

    Writer.Position = &H2CC8F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox22.Text)

    Writer.Position = &H2D04F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox23.Text)

    Writer.Position = &H2D057 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox24.Text)

    Writer.Position = &H2D05F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox25.Text)

    Writer.Position = &H2D063 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox26.Text)

    Writer.Position = &H2D067 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox26.Text)

    Writer.Position = &H2D06B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox27.Text)

    Writer.Position = &H2D077 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox28.Text)

    Writer.Position = &H2D07B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox29.Text)

    Writer.Position = &H2D07F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox30.Text)

    Writer.Position = &H2D083 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox31.Text)

    Writer.Position = &H2D087 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox32.Text)

    Writer.Position = &H2D08B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox33.Text)

    Writer.Position = &H2D84F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox50.Text)

    Writer.Position = &H2D857 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox49.Text)

    Writer.Position = &H2D85F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox52.Text)

    Writer.Position = &H2D863 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox51.Text)

    Writer.Position = &H2D867 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox51.Text)

    Writer.Position = &H2D86B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox54.Text)

    Writer.Position = &H2D877 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox53.Text)

    Writer.Position = &H2D87B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox55.Text)

    Writer.Position = &H2D87F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox46.Text)

    Writer.Position = &H2D883 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox47.Text)

    Writer.Position = &H2D887 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox48.Text)

    Writer.Position = &H2D88B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox45.Text)

    Writer.Position = &H2E047 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox44.Text)

    Writer.Position = &H2E04F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox43.Text)

    Writer.Position = &H2E057 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox42.Text)

    Writer.Position = &H2E05B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox41.Text)

    Writer.Position = &H2E05F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox41.Text)

    Writer.Position = &H2E063 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox40.Text)

    Writer.Position = &H2E06F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox39.Text)

    Writer.Position = &H2E073 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox38.Text)

    Writer.Position = &H2E077 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox37.Text)

    Writer.Position = &H2E07B 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox36.Text)

    Writer.Position = &H2E07F 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox35.Text)

    Writer.Position = &H2E083 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox34.Text)

    Writer.Position = &H2C779 'Insert Offset Here After &H (Delete The 0)
    Writer.WriteInt32(TextBox56.Text)

    Writer.Close()


    End Sub







    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Try
    WriteFile(FilePath)
    ReadFile(FilePath)
    MsgBox("Jangan lupa rehash and resign!", MsgBoxStyle.Information, "")
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
    End Try
    End Sub

    End Class

    [/spoiler]

  2. #2
    vb Coda .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    18,743

    Re: Conversion from string "" to type 'Integer' is not valid

    Writer.WriteInt32(TextBox6.Text)

    this will only work if TextBox6.Text contains a valid integer. if it contains nothing "" it'll cause an error. if it contains "hello" it'll cause an error. the same applies to all similar lines too.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    3

    Re: Conversion from string "" to type 'Integer' is not valid

    Quote Originally Posted by .paul. View Post
    Writer.WriteInt32(TextBox6.Text)

    this will only work if TextBox6.Text contains a valid integer. if it contains nothing "" it'll cause an error. if it contains "hello" it'll cause an error. the same applies to all similar lines too.
    i want to convert the string to integer by write number on it/textbox and convert it again to hex values.....and one of the offset i want to write is contain a value of "0" like "00000000" can it is cause a valid integer?

  4. #4
    vb Coda .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    18,743

    Re: Conversion from string "" to type 'Integer' is not valid

    i don't understand the question

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    3

    Re: Conversion from string "" to type 'Integer' is not valid

    i finally found the problem sir thanks for your advice.......(it because i dont fill the blank textbox with a integer)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.