PC*MILER Rail-Connect can calculate routes with many stops. When the client application adds stops to a trip, the DLL tries to "geocode" (match) the input place (station name/state, SPLC, etc.) to the PC*MILER Rail rail database. PC*MILER Rail-Connect station names are limited to 20 characters for the station name plus 2 characters for the state abbreviation. Geographic codes can be 6 digits for a SPLC or 5 digits for FSACs (with leading zeros), 9 characters for ERPCs, and 5 characters for Rule260s.


The functions below are used to manage a trip’s list of stops.



HRESULT PCRSAddStop(Trip trip, char *stopName, char *rrIn, char *geoChar)

HRESULT PCRSDeleteStop(Trip trip, int which)


PCRSAddStop() appends a stop-off in the stop list (or origin stop if list is empty). Places will be geocoded and the first match will be used in the event that more than one match exists (via PCRSGeoLookup()). PCRSAddStop() returns the number of matching cities (or 0 if no cities match), and -1 on error. PCRSDeleteStop() deletes a stop at index number which, with stop number 0 being the origin. If the stop is invalid, it was not added to the trip’s list. This means that the trip will recalculate, but the mileage and the route will not include the invalid stop-off.



HRESULT PCRSGetNumStops(Trip trip, int pNumStops)


PCRSGetNumStops() is used to get the total number of stops currently in the trip’s stop list, including origin and destination.



HRESULT PCRSGetStop(Trip trip, int which, char *buffer, int bufSize, int NumChars, char *rr)


PCRSGetStop() will put a stop name into the supplied buffer. Use which to index into the list of stops. Stop number 0 is the origin. The resulting string will be a NULL terminated string, and could be as long as 24 bytes. The input buffer should be at least 24 bytes long in order to contain the entire string. If bufSize is less than 24 bytes, then bufSize-1 characters will be copied into buffer. PCRSGetStop() places the number of characters copied into the buffer into the given pointer numChars.



HRESULT PCRSClearStops(Trip trip)


PCRSClearStops() removes all stops from the stop list.