mob wrote:
Is "getCourse" going to be the most accurate way to plot a course? Ive seen it done a number of different ways but very few use getCourse to do it, some get the course through interrogation and assign to a var. What would be the easiest/accurate way to do this?
Usually the method is contextual. That is, GetCourse quieries the TWX DBase and returns a "-1" if a course cannot be plotted. Keep in mind that this sometimes is the result of a course plot longer than the max course (usually 45 Hops). GetCourse in the newer TWX PROXY will work with Avoids that you set via the SetAvoid cmd in TWX.
Using the CIM to plot a course is generally ideal when you don't have a completed Map, Avoids are considered. Generally this is the better way to Go, as Managing Avoids within TWX is as sucessful as the Scripts you use that manage them.
Naturally queying the DBase is faster (my latest YourIT script has an option to plot or not-plot).
Code:
GetCourse $COURSE $START $DESTINATION
if ($COURSE = "-1")
send "^F" & $START & "*" & $DESTINATION & "**Q"
waiton ": ENDINTERROG"
GetCourse $COURSE $START $DESTINATION
if ($COURSE = "-1")
Echo "**Unable to Plot Course**"
Halt
halt
end
..That's what I usually do.