Escape A Loop

ceaser

Active Member
Licensed User
Hi

In the following routine where the program tries to read a Total Station, how can I get the program to escape from this loop. :sign0085:"Button2" on another form calls this routine.

Sub ReadStation(R,R1)
ReadAgain:
HVD(1)=0 :HVD(2)=0 :HVD(3)=0 :f=0
If Main.DF(3)=1 Then
'Leica Total Station
suh(1)="21." :suh(2)="22." :suh(3)="31."
If Main.DF(4)>=3 Then ' tc500,tc1010,tc1610
If R="u" Then
stcm="GET/M/WI11/WI21/WI22/WI31"
Else If R="t" Then
stcm="GET//WI11/WI21/WI22"
If Main.DF(4)=3 OR Main.DF(4)=9 Then
Serial1.Output("SET/160/0" & EndLine)
End If
End If
Serial1.Output(stcm & EndLine)
Else
Serial1.Output(R & EndLine)
End If
A=Serial1.InputString
'If Main.DF(4)<>9 Then Serial1.Output("?" & EndLine)
Else If Main.DF(3)=6 Then
'Sokkia
Serial1.Output(su(R))
End If
If StrLength(A)<10 Then Goto ReadAgain

'split the string up
'Msgbox(A)
Do
f=f+1
A1=(StrIndexOf(A,suh(f),0))
If A1<>-1 Then
HVD(f)=SubString(A,A1+7,8)
If f=3 Then
'distance
HVD(f)=HVD(f)/1000
Else
'horizontal & vertical winkel
HVD(f)=HVD(f)/100000
End If
End If
Loop Until f=R1
End Sub

Thanks
Michael
 

MM2forever

Active Member
Licensed User
Longtime User
If i understand you right, then you should add an e.g boolean variable to your conditions that is changed by a button or something else... with every start of this routine the boolean has to be reseted.

If StrLength(A)<10 and escape=False Then Goto ReadAgain

Btw: Is this the thing you are dealing with? :Total station - Wikipedia, the free encyclopedia
 
Last edited:

ceaser

Active Member
Licensed User
Thanks Guys:sign0188:

That has shed some light on my problem.:)

You are right MM2, that is the instrument that I use in my work. I have the Robotic Total Station (S6 from Trimble)

Thanks
Michael
 
Top