' This is a sample showing how to read from a serial port
' using ScriptBasic
'

print "\nStarted\n"

on error goto ErrorLabel

open "asy0" for input as 1

on error goto OtherError

for i = 1 to 5
  print "waiting for line", i, ":\n"
  line input #1,a
  print "Line ", i, " is ", a, "\n"
next i
close 1

print "No error\n"
goto FinishLabel

ErrorLabel:
print "An error occured opening the serial port\n"
goto FinishLabel

OtherError:
print "An error occurred\n"

FinishLabel:
