This function will parse a comma delimited string and return the nth field.

 

NOTE:

GetStringField was previously required for text character fields, and GetNumberField was required for number fields before GetField was created to handle both data types.

 

Returns a string, which will be converted to a number if necessary.

 

This function is often used in conjunction with the file manager's ReadLine function to read comma delimited files, and with the GetFieldCount function to discover how many fields are available.

 

Syntax:

returnString = GetField( stringValue, fieldIndex )

 

Parameter:

Description:

stringValue

comma delimited string

fieldIndex

number of the field to extract

returnString

string value of the extracted field

 

Note:

The GetField function replaced both the GetStringField and the GetNumberField functions from prior versions.

This new function will return a string or a number as necessary.

 

Example:

stringValue = "S,10,20,30,40"
 
returnString = GetField( stringValue, 1 ) '  Returns "S"
 
returnValue = GetField( stringValue, 3 ) '  Returns the number 20

 

Results:

  See example comments.

 

Links:

GetFieldCount, ReadLines, RemoveCommasBetweenQuote, RemoveNonDigits

See Also:

Data Groups and Types

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 352

 

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software