Last active
October 13, 2019 07:23
-
-
Save bero/f38385e914eaf63125af7b3eb4330edd to your computer and use it in GitHub Desktop.
E2094 'operator+' not implemented in type 'UnicodeString' for arguments of type 'int'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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