Method: GetNextStringValue for File
- Updated2024-09-12
- 2 minute(s) read
DataPlugin > Methods > Method: GetNextStringValue for File
Method: GetNextStringValue for File
Reads a value at the current file position and moves the file pointer according to the data type of the value.
The method reads up to the delimiter specified by File.Formatter.Delimiters. If no delimiter is found, the method reads up to the line feed character specified by File.Formatter.LineFeeds.
vGetNextStringValue = Object.GetNextStringValue(DataType)
| Object | File Object with this method | ||||||||||||||||||||||||||||||||||||
| DataType | Specifies the date type of the value to be read out. Enumeration with the following selection terms:
|
||||||||||||||||||||||||||||||||||||
| vGetNextStringValue | Variant Receives the value that has been read out. When the method reaches the end of the line, the return value is a VT_EMPTY type variant. If the method cannot read out any values between two delimiters or after a delimiter, the return value is a VT_NULL type variant. |
| Note Because GetNextStringValue does not advance past the end of the line, you must use File.SkipLine to position the file pointer in the next line. |
The following example reads text from a file. The texts are delimited by a colon within the line. The texts are names and values of Root properties.
Dim PropName, PropValue File.Formatter.LineFeeds = vbNewLine File.Formatter.Delimiters = ":" While not File.Position = File.Size PropName = File.GetNextStringValue(eString) PropValue = File.GetNextStringValue(eString) Call Root.Properties.Add(PropName, PropValue) Call File.SkipLine() Wend