Hi Glenn,
Here is a snippet of my code where it was used.
 Code:
For Each $Line in $aFileA
		If InStr($Line, ",Name,")
			writeline($handle2,@crlf + $Line)
		endif
		Select
			Case InStr($Line, "wibble") <> 0			
				$Target = AScan($Catfiltarray, $Line,,,1) ; Argument tells script to look for partial match
				If $Target <> -1 					; was found!
													; $Target is the line number in File B's array - read that and extract data until the next header is found
					For $P = $Target to $Target + 999 ; scan next 999 lines or till we find the next header
						If $P > $Target And InStr($Catfiltarray[$P], ',Name,') ; found the NEXT header
							$P = $Target + 1000 						; terminate the loop
						Else
							Select 
								case InStr(substr($Catfiltarray[$P],2,9), "Category")				;searching for a line conatining the string Category
									$Catfiltarray[$P] = trim(substr($Catfiltarray[$P], 10))					;some sorting to make results more readable
									$Catfiltarray[$P + 1] = trim(substr($Catfiltarray[$P + 1], 9))
									writeline($handle2,$Catfiltarray[$P] + "," + $Catfiltarray[$P + 1] + @crlf)
								case InStr($Catfiltarray[$P], ",Name,")
									$Catfiltarray[$P] = trim(substr($Catfiltarray[$P], 8))
									$comma = trim(substr($Catfiltarray[$P],1,1))
									if $comma = ","										;If statement compensating for more than 10 catagories present in websense 
										$Catfiltarray[$P] = trim(substr($Catfiltarray[$P], 9))		;Will start trimming from 9 characters instead of 8, compensate for 2 character numbers					
									endif
									writeline($handle2,@crlf + ",Category - ," + $Catfiltarray[$P] + @crlf)
							EndSelect
						EndIf
					Next
				EndIf
			Case InStr($Line, "wibble2") <> 0			
				$Target = AScan($limfilarray, $Line,,,1) ; Argument tells script to look for partial match
				If $Target <> -1 					
					For $P = $Target to $Target + 999 ; scan next 999 lines or till we find the next header
						If $P > $Target And InStr($limfilarray[$P], ',,') 
							$x = writeline($handle2,@crlf)
							$P = $Target + 1000 						
						Else
							If Instr($limfilarray[$P], "http")
								$x = writeline($handle2,@crlf + ",Filter" + $limfilarray[$P])
							endif
						EndIf
					Next
				EndIf
		EndSelect
	Next

Please forgive any bad practices it was a rather time constrained write!
Cheers,
Tom