Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TMask for a StringList , how?

Posted on 2003-12-09
7
Medium Priority
?
691 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 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 100 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

704 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