01.07.2013 Views

9. Anexos.

9. Anexos.

9. Anexos.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

If bFileExists(sFile) = True Then<br />

Open sFile For Input As #nFile<br />

Input #1, NumeroNodos, lNumArcos<br />

ReDim Vector(lNumArcos)<br />

For i = 1 To lNumArcos<br />

Input #nFile, Vector(i).Origen, Vector(i).Destino, Vector(i).Longitud<br />

Vector(i).Posicion = i<br />

Next i<br />

Input #nFile, lNumNodosOrigen<br />

ReDim NodosOrigen(lNumNodosOrigen)<br />

Input #nFile, sTemp<br />

While Left$(sTemp, 1) = ESPACIO<br />

LTrim (sTemp)<br />

Wend<br />

lStartPos = 1<br />

For i = 1 To (lNumNodosOrigen - 1)<br />

lEndPos = InStr(lStartPos, sTemp, ESPACIO)<br />

NodosOrigen(i) = Val(Mid(sTemp, lStartPos, lEndPos - lStartPos))<br />

lStartPos = lEndPos + 1<br />

Next i<br />

NodosOrigen(i) = Val(Mid(sTemp, lStartPos))<br />

If Not EOF(nFile) Then<br />

Input #nFile, CosteOptimo<br />

Else<br />

CosteOptimo = -1<br />

End If<br />

Close #nFile<br />

End If<br />

End Sub<br />

Public Function bFileExists(sFile As String) As Boolean<br />

If sFile = "" Then bFileExists = False Else bFileExists = True<br />

End Function<br />

Public Function GetFiles(Optional ByVal sTitle As String = "Open files...") As String<br />

<strong>Anexos</strong>.<br />

45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!