C1Awk Reference > C1Awk Properties > FieldAt Property |
Returns the number of the field at the specified string position.
val% = [form!]C1Awk.FieldAt(index As Integer)
This property was designed to be used with Visual Basic's InStr function. The first string position is 1.
This property is useful when you want to process a field based on its contents rather than on its position. See also the PosAt property, which performs the reverse function.
For example, the following code uses the PosAt property to find the contents of the field after the string "value."
Example Title |
Copy Code
|
---|---|
' find the tag awk = "stuff stuff stuff stuff value data stuff stuff" debug.print awk.FieldAt(instr(awk, "value")) 5 ' get the value debug.print awk.f(5+1) data ' one-stop shopping debug.print awk.f(awk.FieldAt(instr(awk, "value"))+1) data |
Integer