Question Error with code line writing!

noam309

Member
Joined
Aug 2, 2006
Messages
9
Location
ISRAEL
Programming Experience
Beginner
Hi,

I use vbnet 2005 pro. and I program for pocket pc wm2003,
I have forms and a modul with my app.
this is a part of the modul:
Code:
Public F1 As Double
    Public G1 As Double       ' תוצאות חישוב טופס 5
    Public H1 As Double
    Public I1 As Double
    Public J1 As Double
and this is code is on botton click on a form:
Code:
F1 = TextBox4.Text
        G1 = TextBox5.Text
        H1 = TextBox7.Text  '  מצב יניקה
        I1 = TextBox12.Text
        J1 = ""
it means that when I click the botton it send the values in the textboxes into the modul public variables , and I can use these variables on other forms.
the problem is on : J1="" it gives error ,why ?
what should I do when I want to send a zero (nothing) into the public variable in the modul?

hope that I am clear, it gives an error only with this line :J1="" ,should I write this line differently?

thanks.
 

kulrom

Well-known member
Joined
May 10, 2005
Messages
2,854
Location
Republic of Macedonia
Programming Experience
10+
J1 is declared as Double so you cannot assign an empty string to a Double
Rather try this:
Code:
        F1 = TextBox4.Text
        G1 = TextBox5.Text
        H1 = TextBox7.Text  '  מצב יניקה
        I1 = TextBox12.Text
        J1 = 0
Or just ignore it (it's already zero)
 

noam309

Member
Joined
Aug 2, 2006
Messages
9
Location
ISRAEL
Programming Experience
Beginner
Thank you ! works fine.
 
Last edited:
Top Bottom