Solved

TMask for a StringList , how?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month4 days, 17 hours left to enroll

636 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