Public Function GetPossiblyQuotedField( _ ByRef rLine As Variant _ , Optional ByVal vQuoteString As Variant _ , Optional ByVal vFieldSeparator As Variant _ , Optional ByVal vCompare As Variant _ ) As Variant
Assuming Dim S As String S = "'First field','Second Field',45.67" for example GetPossiblyQuotedField(S, "'", ",") = "First Field" leaves S = "'Second Field',45.67"See also:
StripDoubleQuotes Function GetVBToken FunctionrLine: The line containing the fields of which the first is to be removed and returned. Function returns Null if rLine is Null or cannot be fixed up to a String.
Function returns an empty string if rLine is an empty string.
vQuoteString: The string which may possibly quote string-type fields. vQuoteString defaults to the double quote character if it is missing or Null or cannot be fixed up to a String.
vFieldSeparator: The string which separates fields within string rLine. vFieldSeparator defaults to the comma character if it is missing or Null or cannot be fixed up to a String. If the field separator is an empty string, then the string rLine is considered to consist of a single field.
vCompare: Specifies the type of comparison used to determine if the quote and field separator strings match portions of string rLine. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.
If the first field is not quoted and is numeric, then its value is returned as a Double.
If the first field is not quoted and it is a value date, then it is returned as a Date.
Any other non-quoted values are returned as strings.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.