Browse Source

* operator overload not allowed

peter 21 years ago
parent
commit
6ced282cbc
1 changed files with 20 additions and 0 deletions
  1. 20 0
      tests/tbf/tb0161.pp

+ 20 - 0
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.
+