Skip to content

Instantly share code, notes, and snippets.

@bero
Last active October 13, 2019 07:23
Show Gist options
  • Save bero/f38385e914eaf63125af7b3eb4330edd to your computer and use it in GitHub Desktop.
Save bero/f38385e914eaf63125af7b3eb4330edd to your computer and use it in GitHub Desktop.
E2094 'operator+' not implemented in type 'UnicodeString' for arguments of type 'int'
program Project6;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
function MatchPattern(const pattern, s: string): boolean;
var
i: integer;
begin
result := length(pattern) = length(s);
// Add breakpoint here
// Evaluate or watch variable s[0].
// Result is "E2094 'operator+' not implemented in type 'UnicodeString' for arguments of type 'int'"
if result then
for i := 1 to length(pattern) do
case pattern[i] of
'#':
result := result and CharInSet(s[i], ['0'..'9']);
else
result := result and (s[i] = pattern[i]);
end;
end;
begin
try
if MatchPattern('####-##-## ##:##', '2007-04-05T14:30') then
WriteLn('True')
else
WriteLn('False');
Readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment