A
Arpan
I am trying to make a calculator in ASP.NET using VB.NET but certain errors are cropping up. This is a part of the code (please note that the code lines that are bold & in red colour generate the errors):
<%@ Page Language="VB" Debug="true" Explicit="true" %>
<%@ Import Namespace="System.Drawing.Color" %>
<%@ Import Namespace="System.Math" %>
Sub btnInv(obj As Object,ea As EventArgs)
If(invnum1.Value="") Then
If(num1.Value<>"") Then
answer.Text=Left(1/num1.Value,13)
invnum1.Value=num1.Value
Else
If(storemem.Value<>"") Then
answer.Text=Left(1/storemem.Value,13)
End If
End If
End Sub
This is the error that is being generated:
The operands to '/' are of types 'System.Integer' & 'System.String', which are not appropriate for this operator.
If I comment out the above lines, another error gets generated as shown below:
Sub btnMR(obj As Object,ea As EventArgs)
If((op="") And (storemem.Value<>0)) Then
..................
..................
End If
If((op<>"") And (storemem.Value<>0)) Then
.................
.................
End If
End Sub
This is the second error that is being generated:
The operands to '<>' are of types 'System.String' & 'System.Integer' which are not appropriate for this operator.
If I comment out the above lines as well, a third error gets generated as shown below:
Sub btnMC(obj As Object,ea As EventArgs)
If((op<>"") And (storemem.Value=0)) Then
...............
...............
End If
If((op="") And (storemem.Value=0)) Then
..............
..............
End If
End Sub
& this is the error message:
The operands to '=' are of types 'System.String' & 'System.Integer', which are not appropriate for this operator.
I am not understanding why are the errors being generated. Could somebody please help me out to overcome the above-mentioned errors?
I am working on Windows 2K Professional & have .NET Framework v.1.0.2204 installed in my m/c.
Thanks,
Arpan
<%@ Page Language="VB" Debug="true" Explicit="true" %>
<%@ Import Namespace="System.Drawing.Color" %>
<%@ Import Namespace="System.Math" %>
Sub btnInv(obj As Object,ea As EventArgs)
If(invnum1.Value="") Then
If(num1.Value<>"") Then
answer.Text=Left(1/num1.Value,13)
invnum1.Value=num1.Value
Else
If(storemem.Value<>"") Then
answer.Text=Left(1/storemem.Value,13)
End If
End If
End Sub
This is the error that is being generated:
The operands to '/' are of types 'System.Integer' & 'System.String', which are not appropriate for this operator.
If I comment out the above lines, another error gets generated as shown below:
Sub btnMR(obj As Object,ea As EventArgs)
If((op="") And (storemem.Value<>0)) Then
..................
..................
End If
If((op<>"") And (storemem.Value<>0)) Then
.................
.................
End If
End Sub
This is the second error that is being generated:
The operands to '<>' are of types 'System.String' & 'System.Integer' which are not appropriate for this operator.
If I comment out the above lines as well, a third error gets generated as shown below:
Sub btnMC(obj As Object,ea As EventArgs)
If((op<>"") And (storemem.Value=0)) Then
...............
...............
End If
If((op="") And (storemem.Value=0)) Then
..............
..............
End If
End Sub
& this is the error message:
The operands to '=' are of types 'System.String' & 'System.Integer', which are not appropriate for this operator.
I am not understanding why are the errors being generated. Could somebody please help me out to overcome the above-mentioned errors?
I am working on Windows 2K Professional & have .NET Framework v.1.0.2204 installed in my m/c.
Thanks,
Arpan