Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

Help with GoTo statements and looping

$
0
0
Firstly, I'm new.

I'm scripting something that uses FORTRAN and need some help... I believe IF/THEN statements don't work properly here, so I'm forced to use "GoTo" statements.

**Goal**: I'm trying to create a script that repeats itself, then stops when it recognizes the end point. The end statement is "Waiting for Prompt: Default Portal:" Each time I run this, I want it to remove a random set of lines. I successfully got this to run a static 16 times, but wanted something more automated. The system I'm trying to run the script on is CLI based, if that helps.

**Problem**: It seems to get stuck in a loop, I think.

**Code**: See below...
*************************
rmvseconds:

.TransmitTerminalKey rcVtUpKey

.TransmitTerminalKey rcVtSelectKey

.TransmitTerminalKey rcVtRemoveKey

.Transmit CR

.StatusBar = ""

.Transmit "Y"

.StatusBar = ""

.Transmit CR

If .StatusBar = "Waiting for Prompt: Default Portal:" Then
GoTo ending
Else
GoTo rmvseconds:

ending:
.Transmit CR

.Transmit CR

End If

ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly


End Sub
********************

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>