Browse Source

+ bug0308 and bug0308a

Jonas Maebe 25 years ago
parent
commit
291eb87a54
3 changed files with 33 additions and 1 deletions
  1. 5 0
      bugs/bug0308.pp
  2. 26 0
      bugs/bug0308a.pp
  3. 2 1
      bugs/readme.txt

+ 5 - 0
bugs/bug0308.pp

@@ -0,0 +1,5 @@
+uses bug0308a;
+
+begin
+  writeln(coursedb.name(60));
+end.

+ 26 - 0
bugs/bug0308a.pp

@@ -0,0 +1,26 @@
+unit bug0308a;
+
+interface
+
+type
+  tcourses = object
+    function index(cName: string): integer;
+    function name(cIndex: integer): string;
+  end;
+
+var coursedb: tcourses;
+    l: longint;
+
+implementation
+
+function tcourses.index(cName: string): integer;
+begin
+  index := byte(cName[0]);
+end;
+
+function tcourses.name(cIndex: integer): string;
+begin
+  name := char(byte(cIndex));
+end;
+
+end.

+ 2 - 1
bugs/readme.txt

@@ -396,4 +396,5 @@ bug0262.pp   problems with virtual and overloaded methods
 bug0293.pp   no error with variable name = type name
 bug0299.pp   passing Array[0..1] of char by value to proc leads to problems
 bug0305.pp   Finally is not handled correctly after inputting 0
-bug0307.pp   "with object_type" doesn't work correctly!
+bug0307.pp   "with object_type" doesn't work correctly!
+bug0308a.pp  problem with objects that don't have VMT nor variable fields