Craig- Here's a variation using an array: function MyFindLines pTextToFind, pVariable local tArray local tLineNumber put 0 into tLineNumber repeat for each line tLine in pVariable if pTextToFind is in tLine then put tLine into tArray[tLineNumber] end if add 1 to tLineNumber end repeat return tArray end MyFindLines -- -Mark Wieder mwieder at ahsoftware.net