Moein/Rouzbah
Member
Hello every one
Log:
So i receive something like this:
.............................
Name=v2 V.x= x2 V.y= y2
Name=v2 V.x= x2 V.y=y2
.............................
Where is the problem, please?
B4X:
Sub Globals
Dim lstEdges As List
Type Vertex(vName As String,Xcoordinate As Double,Ycoordinate As Double,Color As String, Forbiden As Boolean)
Dim sVertex As Vertex
Dim eVertex As Vertex
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("MainLayout")
lstEdges.Initialize
End Sub
Private Sub pnlGraph_Touch (Action As Int, X As Float, Y As Float)
if something then
sVertex.vName="V1"
sVertex.Xcoordinate=X1
sVertex.Ycoordinate=Y1
else
eVertex.vName="V2"
eVertex.Xcoordinate=X2 'different from X1'
eVertex.Ycoordinate=Y2 'different from Y1'
end if
lstEdges.Add((Array(sVertex,eVertex)))
End Sub
B4X:
Sub info
For i =0 To (lstEdges.Size)-1
Dim V As Vertex=EdgeTable.Get(i)
Log( " Name= " & V.vName & " V.x= " & V.Xcoordinate & " V.y= " & V.Ycoordinate)
Next
end sub
.............................
Name=v2 V.x= x2 V.y= y2
Name=v2 V.x= x2 V.y=y2
.............................
Where is the problem, please?
Last edited: