blob: 59bb2032aa9679df6298e9340a90e50cbb3b6f04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{ Source provided for Free Pascal Bug Report 4119 }
{ Submitted by "C Western" on 2005-06-26 }
{ e-mail: mftq75@dsl.pipex.com }
{$mode delphi}
uses StrUtils;
function mypos(s1,s2 : widestring) : integer;overload;
begin
result:=pos(s1,s2);
end;
function mypos(s1,s2 : ansistring) : integer;overload;
begin
result:=pos(s1,s2);
end;
function mypos(s1,s2 : shortstring) : integer;overload;
begin
result:=pos(s1,s2);
end;
var
s:AnsiString;
p:ShortString;
ws:widestring;
begin
s:=DupeString('a',300)+'b';
ws:=s;
p:='b';
WriteLn(MyPos('b',s));
WriteLn(MyPos(p,s));
WriteLn(MyPos(p,ws));
end.
|