OpenFile Method
Opens and reads a text file of NMEA 0183 data.
Syntax
Visual Basic
object.OpenFileFilename[, TimeScale]
Visual C++
object.OpenFile(Filename, TimeScale)
| Part
| Description |
| object |
An object expression that evaluates to a GPS ToolKit object. |
| Filename |
A string containing the name of the input file.
|
| TimeScale |
A value from 0 to 1000 indicating how fast the file data is consumed. This parameter is optional in VB and defaults to 0.
|
Example
Visual Basic
myGPSToolKit.OpenFile "C:\GPSData.txt", 1
Visual C++
_variant_t vtTimeScale((short)1);
_variant_t vtFilename("C:\\GPSData.txt");
m_myGPSToolKit.OpenFile(vtFilename, vtTimeScale);
Remarks
- TimeScale is a "multiplier" that determines the speed at which the file GPS data is read.
A value of 1 causes GPS ToolKit to "play" the file in real time, while a value of 10 tells GPS ToolKit
to "play" the file 10 times faster than real time. Likewise, a value of 0.1 tells GPS ToolKit to read
the file 10 times more slowly. A value of 0 indicates that GPS ToolKit should read the file as quickly
as possible.
- The file read may be cancelled during execution by calling the Close method.
- Upon completion or cancellation of the file read, GPS ToolKit will fire the FileComplete event.
Returns
Nothing
Errors
- After opening a port using OpenFile(), any subsequent call to Open() or OpenFile() will cause
GPS ToolKit to throw a "Port or file is already open" exception.
- If unable to find or open the specified file, GPS ToolKit will throw a "Unable to open file" exception.
See Also
BaudRate property, Open method, Close method
|