Solved

TMask for a StringList , how?

Posted on 2003-12-09
7
656 Views
Last Modified: 2007-12-19
A TMask is to determine if a string matches the format described by a mask.



But how do determine if a LIST OF STRINGS matches the format described by a mask ? any method or function available?  or i have to use iteration ???
0
Comment
Question by:jiekuan
  • 2
  • 2
7 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 25 total points
ID: 9910079
>or i have to use iteration ???
yes, each string of the list must be evaluated with the mask

0
 
LVL 2

Assisted Solution

by:Robn
Robn earned 25 total points
ID: 9914011
function MaskMatches(Strings: TStrings; Mask: TMask): Boolean;
var
  i: Integer;
begin
  result := False;
  for i := 0 to Strings.Count - 1 do begin
    if not Mask.Matches(Strings[i]) then Exit;
  end;
  result := True;
end;
0
 

Author Comment

by:jiekuan
ID: 9918785
so that means Mask is only for string? not stringList
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9918798
>so that means Mask is only for string?
yep, robn shows, how to handle it with a stringlist
0
 

Author Comment

by:jiekuan
ID: 9918914
why
'ball?????????'

can match

'ball'  ?


 m:=TMask.Create(lowerCase('ball?????????'));

m.Matches(LowerCase(ball)) is TRUE?

why 'ball???????' can match 'ball'
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question