Solved

TMask for a StringList , how?

Posted on 2003-12-09
7
650 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now