unit SysUtilsStrScan;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SysUtilsStrScan
// Routine: SysUtils.StrScan

// BeginCode
{
The following example uses a button on a form. When the
button is clicked, the text is searched for a wildcard
(asterisk character).
}
function HasWildcards(FileName: PChar): Boolean;
{ Return true if file name has wildcards in it }
begin
  HasWildcards := (StrScan(FileName, '*') <> nil) or
    (StrScan(FileName, '?') <> nil);
end;

procedure TForm1.Button1Click(Sender: TObject);
const
  P: PChar = 'C:\Test.* ';
begin
  if HasWildcards(P) then
    ShowMessage('The string has wildcards')
  else
    ShowMessage('The string does not have wildcards');
end;
// EndCode
// EndExample: SysUtilsStrScan
end.
