From 6ced282cbc33edd44d2141b922a65d6588b98cd6 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 18 Mar 2004 16:22:06 +0000 Subject: [PATCH] * operator overload not allowed --- tests/tbf/tb0161.pp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/tbf/tb0161.pp diff --git a/tests/tbf/tb0161.pp b/tests/tbf/tb0161.pp new file mode 100644 index 0000000000..2c410e7629 --- /dev/null +++ b/tests/tbf/tb0161.pp @@ -0,0 +1,20 @@ +{ %fail } + +uses Strings; + +Function PosEx(const SubStr, S: string; Offset: Cardinal): Integer; + +var i : pchar; +begin + if (offset<1) or (offset>length(s)) then exit(0); + i:=strpos(@s[1],@substr[offset]); + if i=nil then + PosEx:=0 + else + // This should be forbidden + PosEx:=(i-s)+offset; +end; + +begin +end. +