Private Sub Cmd_Click()
Dim i As Integer,j As lnteger,k As Integer
Dim x1 As Single,yl As Single,x2 As Single,y2 As Single
Dim d As Single,Totald As Single,v As Single,s As String
s= ①
x1=0:y1=0 '出发点为坐标原点
k=1:j=1:Totald=0
For i=1 To Len(s)
If Mid(s,i,1)="," Then
v=Val(Mid(s,j,i-j))'提取坐标值,保存在变量ν中
j=i+1
lf ② Then
x2=v
Else
y2=v
d=Sqr((x2-x1)^2+(y2-y1)^2)
Totald=Totald+d
x1=x2:y1=y2
End If
k=k+1
End If
Next i
Label1.Caption=Str(Totald)
End Sub
①②