Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-08

for n:=0 to

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Carsten Bager

I have a program like below, and if the control variable (nr) is defined as a byte/word it fails (the count goes from 1..14) But if I use an Integer as control variable it works.
Is this an error in the compiler?

If I use the Windows compiler (fpc) it works.

Carsten

-------------------------------------------------------------------------------- Free Pascal Compiler version 2.0.2 [2006/02/28] for arm Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Linux for ARM
-----------------------------
Function I2CLaesRecord(recNr:word16;Var dat:ByteArray16_typ):Boolean;   Var
    ChipNr,nr:Byte;
    adr:word16;
    Label 1;
  Begin
....

               For nr:=0 to 14 do                    
                 dat[nr]:=I2C_LaesByte(True);
------------------------
Jonas Maebe
to Carsten Bager
Carsten Bager wrote 7 lines
I have a program like below, and if the control variable (nr) is defined as a byte/word it fails (the count goes from 1..14) But if I use an Integer as control variable it works. Is this an error in the compiler? If I use the Windows compiler (fpc) it works.

Please submit a compilable sample which demonstrates the problem at http://www.freepascal.org/mantis (and mention it's for Arm/Linux)

Jonas