Sign in Join

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

Mailing lists / fpc-devel / 2006-05

Ordinal expression expected issues

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

ik

Hi,

I have the following code:

const MAXITEMS = 4;
type
  Tmyrec = record
     item : string;
     items : array [0..MAXITEMS] of stirng;
     moreitem : string;
  end;

...
for i := Low (myrec) to high (myrec) do
...

On ppcx64, the above code works very well, but on the same compiler version (2.0.2) on 386, I'm getting the above error message.

Even if i'll do the for loop as follows:

for i := 0 to MAXITEMS do
...

The error message continues ...

What am I doing wrong ?

Thanks,

Ido

Reply by email

ik
to ik

Replaying to myself.

i was Int64. (The original array was dynamic array, thats was the reason to use Int64).

Ido

ik wrote 33 lines
Hi, I have the following code: const MAXITEMS = 4; type Tmyrec = record item : string; items : array [0..MAXITEMS] of stirng; moreitem : string; end; ... for i := Low (myrec) to high (myrec) do ... On ppcx64, the above code works very well, but on the same compiler version (2.0.2) on 386, I'm getting the above error message. Even if i'll do the for loop as follows: for i := 0 to MAXITEMS do ... The error message continues ... What am I doing wrong ? Thanks, Ido

Reply by email

Florian Klaempfl
to ik
ik wrote
Replaying to myself. i was Int64. (The original array was dynamic array, thats was the reason to use Int64).

making i an int64 makes no sense on 32 bit platforms even not for dyn. arrays.

Show quoted text 41 lines
Ido On 5/21/06, ik wrote: > Hi, > > I have the following code: > > const MAXITEMS = 4; > > type > Tmyrec = record > item : string; > items : array [0..MAXITEMS] of stirng; > moreitem : string; > end; > > ... > for i := Low (myrec) to high (myrec) do > ... > > On ppcx64, the above code works very well, but on the same compiler > version (2.0.2) on 386, I'm getting the above error message. > > Even if i'll do the for loop as follows: > > for i := 0 to MAXITEMS do > ... > > The error message continues ... > > What am I doing wrong ? > > Thanks, > > Ido > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

ik
to Florian Klaempfl
Florian Klaempfl wrote 8 lines
ik wrote: > Replaying to myself. > > i was Int64. (The original array was dynamic array, thats was the > reason to use Int64). making i an int64 makes no sense on 32 bit platforms even not for dyn. arrays.

So what whould be your choice ?
Please note that my program is supposed to work on any linux that have fpc support (regardless of the bits of the machine)

Show quoted text 47 lines
> > Ido > > On 5/21/06, ik wrote: >> Hi, >> >> I have the following code: >> >> const MAXITEMS = 4; >> >> type >> Tmyrec = record >> item : string; >> items : array [0..MAXITEMS] of stirng; >> moreitem : string; >> end; >> >> ... >> for i := Low (myrec) to high (myrec) do >> ... >> >> On ppcx64, the above code works very well, but on the same compiler >> version (2.0.2) on 386, I'm getting the above error message. >> >> Even if i'll do the for loop as follows: >> >> for i := 0 to MAXITEMS do >> ... >> >> The error message continues ... >> >> What am I doing wrong ? >> >> Thanks, >> >> Ido >> > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Florian Klaempfl
to ik
ik wrote 13 lines
On 5/21/06, Florian Klaempfl wrote: > ik wrote: > > Replaying to myself. > > > > i was Int64. (The original array was dynamic array, thats was the > > reason to use Int64). > > making i an int64 makes no sense on 32 bit platforms even not for dyn. > arrays. So what whould be your choice ? Please note that my program is supposed to work on any linux that have fpc support (regardless of the bits of the machine)

Use SizeInt.

Show quoted text 52 lines
> > > > > Ido > > > > On 5/21/06, ik wrote: > >> Hi, > >> > >> I have the following code: > >> > >> const MAXITEMS = 4; > >> > >> type > >> Tmyrec = record > >> item : string; > >> items : array [0..MAXITEMS] of stirng; > >> moreitem : string; > >> end; > >> > >> ... > >> for i := Low (myrec) to high (myrec) do > >> ... > >> > >> On ppcx64, the above code works very well, but on the same compiler > >> version (2.0.2) on 386, I'm getting the above error message. > >> > >> Even if i'll do the for loop as follows: > >> > >> for i := 0 to MAXITEMS do > >> ... > >> > >> The error message continues ... > >> > >> What am I doing wrong ? > >> > >> Thanks, > >> > >> Ido > >> > > _______________________________________________ > > fpc-devel maillist - > > http://lists.freepascal.org/mailman/listinfo/fpc-devel > > > > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email