R
Rob
Any idease on how to fix ?
The Code in C#
public void Load(string FileName)
{
LineToDraw l;
try
{
this.Clear(true);
StreamReader sr = new StreamReader(FileName);
string line;
while ((line = sr.ReadLine()) != null)
{
l = new LineToDraw();
string[] linesplit = line.Split(Delimiter.ToCharArray());
l.StartX = int.Parse(linesplit[0].ToString());
l.StartY = int.Parse(linesplit[1].ToString());
l.EndX = int.Parse(linesplit[2].ToString());
l.EndY = int.Parse(linesplit[3].ToString());
Points.Add(l);
}
sr.Close();
}
catch (Exception) { throw; }
}
The code translated into VN.net using the AspAlliance site.... it does point
out that there is a problem - other translaters do not
Public Sub Load(FileName As String)
Dim l As LineToDraw
Try
Me.Clear(True)
Dim sr As New StreamReader(FileName)
Dim line As String
' PLEASE LOOK RIGHT BELOW HERE
'The errror message associated with the line below is - 'Is' requires
operands that have reference types, but this operand has the value type
'Boolean'
While Not ((line <<= sr.ReadLine()) Is Nothing) 'ToDo: Unsupported
feature: assignment within expression. "=" changed to "<="
l = New LineToDraw()
Dim linesplit As String() = line.Split(Delimiter.ToCharArray())
l.StartX = Integer.Parse(linesplit(0).ToString())
l.StartY = Integer.Parse(linesplit(1).ToString())
l.EndX = Integer.Parse(linesplit(2).ToString())
l.EndY = Integer.Parse(linesplit(3).ToString())
Points.Add(l)
End While
sr.Close()
Catch
End Try
End Sub 'Load
The Code in C#
public void Load(string FileName)
{
LineToDraw l;
try
{
this.Clear(true);
StreamReader sr = new StreamReader(FileName);
string line;
while ((line = sr.ReadLine()) != null)
{
l = new LineToDraw();
string[] linesplit = line.Split(Delimiter.ToCharArray());
l.StartX = int.Parse(linesplit[0].ToString());
l.StartY = int.Parse(linesplit[1].ToString());
l.EndX = int.Parse(linesplit[2].ToString());
l.EndY = int.Parse(linesplit[3].ToString());
Points.Add(l);
}
sr.Close();
}
catch (Exception) { throw; }
}
The code translated into VN.net using the AspAlliance site.... it does point
out that there is a problem - other translaters do not
Public Sub Load(FileName As String)
Dim l As LineToDraw
Try
Me.Clear(True)
Dim sr As New StreamReader(FileName)
Dim line As String
' PLEASE LOOK RIGHT BELOW HERE
'The errror message associated with the line below is - 'Is' requires
operands that have reference types, but this operand has the value type
'Boolean'
While Not ((line <<= sr.ReadLine()) Is Nothing) 'ToDo: Unsupported
feature: assignment within expression. "=" changed to "<="
l = New LineToDraw()
Dim linesplit As String() = line.Split(Delimiter.ToCharArray())
l.StartX = Integer.Parse(linesplit(0).ToString())
l.StartY = Integer.Parse(linesplit(1).ToString())
l.EndX = Integer.Parse(linesplit(2).ToString())
l.EndY = Integer.Parse(linesplit(3).ToString())
Points.Add(l)
End While
sr.Close()
Catch
End Try
End Sub 'Load