Dear Lister's
    My question is, can I call a Visual C++ shortest route program using the
            Run Program "C:\blah\blah.exe"
    from MB.  What I have at present in MB is a few dialog boxes that asks
the
user to enter the origin - destination nodes, these are then entered into
temporary
ASCII files which I hope the Visual C++ program will read and the output the
shortest
route & start-end coords in an ASCII file which will in turn be imported
into MB.
Please don't mention DLL's or the like, as I am no good at C++ and
relatively
inexperienced in MB.

Also:
    Ideally I would prefer to have the shortest route calculated in MB, so I
could
have dialog boxes that would ask user the weather conditions, and in turn
this would
factor the link weights.  As my network just consists of 32 nodes and 102
links,
I don't think it should take to long to calculate.
I have made an attempt to calculate the shortest route (below).
Origin and Destination are Globals.
TIMES is a MI table that consits of:FROMNODE,  TONODE,  WEIGHT
                                                                (col1)
(col2)        (col3)
This doesn't work at all, just goes into a loop.
This Function is called from the Sub ShortestRoute procedure via:
 Route = Moore()

Hope then to insert Route into a MI table.

Function Moore() As Integer

Dim Link As Integer
Dim TempX As Integer
Dim TempY As Integer

TempY= Str$(Destination)
TempX= Str$(Origin)
Dim k As Integer
TempTime=0
Route =Str$(Origin)
DO While Not EOT(TIMES)
Fetch First From TIMES

 If TIMES.col3< 1000000 Then
   If TempX =TIMES.col1 Then
  If TempY =TIMES.col2 Then
   TempTime =TempTime + TIMES.col3
  If TIMES.col3>TempTime Then
   TempTime=TempTime
   Link =(str$(Link) +str$(TIMES.col2))

   TempX=TIMES.col2
  End If
  End If

  End If
 End If
Fetch Next From TIMES
Route = Str$(Link)
Loop

Anybodies help would be most appreciated.



william G.
End Function


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to