summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw3010.pp
blob: 24dc520b012b297e8ff316161cd9cd675335ff87 (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
36
{ Source provided for Free Pascal Bug Report 3010 }
{ Submitted by "C Western" on  2004-03-13 }
{ e-mail: mftq75@dsl.pipex.com }
program bug1;

{$mode objfpc}{$H+}
{$R+}

uses
  Classes;

function Mumble(var p: TPoint; s: TStringList): Char;
begin
  if p.x = Length(s[p.y]) then
    Result := 'a'
  else
    Result := 'b';
end;

var
  p: TPoint;
  s: TStringList;
  c: char;
begin
  p.x := 7;
  p.y := 0;
  s := TStringList.Create;
  s.Add('1234567');
  c:=Mumble(p, s);
  writeln(c);
  if c<>'a' then
    begin
      writeln('ERROR!');
      halt(1);
    end;
end.