Here is my method:
Code: Select all
procedure findFileAndLoad;
var filenames : TStringList;
var nsfile,targetName : string;
var i:integer;
begin
if targetNameIN.length > 0 then
begin
//get commatext for file list input
filenames.setCommatext(filelistIN.asString);
targetName = targetNameIN.asString;
//search for a filename that ends with the target string
//function string.endswith ( AValue:string ) : boolean;
for i := 0 to filenames.count do
begin
nsfile = filenames.getStrings(i);
//call load text with the found filename
if nsfile.endswith(targetName) then loadText(nsfile);
end;
end;
end; Thoughts?
Thanks!
