 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
dieter Guest
|
Posted: Thu Jan 22, 2004 8:42 am Post subject: High(Array) TQuickRep |
|
|
Hi,
I have declared a dynamic array,
And with for i:=0 to High(Array)-1 I loop through the array.
For each element of the array i have to print a column on a
Quickrep. When i do this on a pc where Delphi is installed
everything works fine, but when i do this on a customers pc
where Delphi is not installed, i never get to print the
last item in the array?
Does anybody know what the problem might be??
Thx
Dieter
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Thu Jan 22, 2004 10:28 am Post subject: Re: High(Array) TQuickRep |
|
|
On 22 Jan 2004 00:42:36 -0800, [email]dieterdebuck (AT) pandora (DOT) be[/email] (dieter) wrote:
| Quote: | Hi,
I have declared a dynamic array,
And with for i:=0 to High(Array)-1 I loop through the array.
For each element of the array i have to print a column on a
Quickrep. When i do this on a pc where Delphi is installed
everything works fine, but when i do this on a customers pc
where Delphi is not installed, i never get to print the
last item in the array?
Does anybody know what the problem might be??
|
For i := 0 To High( Array )
or
For i := 0 To Length( Array ) - 1
I don't see how you /ever/ get the last line with your existing code
|
|
| Back to top |
|
 |
dieter Guest
|
Posted: Thu Jan 22, 2004 2:16 pm Post subject: Re: High(Array) TQuickRep |
|
|
It was
for i:=0 to High(Array)
that I used.
It's still very strange to me that it works on
one pc and not on an other.
[email]erewhon (AT) nowhere (DOT) com[/email] (J French) wrote in message news:<400fa653.178278904 (AT) news (DOT) btclick.com>...
| Quote: | On 22 Jan 2004 00:42:36 -0800, [email]dieterdebuck (AT) pandora (DOT) be[/email] (dieter) wrote:
Hi,
I have declared a dynamic array,
And with for i:=0 to High(Array)-1 I loop through the array.
For each element of the array i have to print a column on a
Quickrep. When i do this on a pc where Delphi is installed
everything works fine, but when i do this on a customers pc
where Delphi is not installed, i never get to print the
last item in the array?
Does anybody know what the problem might be??
For i := 0 To High( Array )
or
For i := 0 To Length( Array ) - 1
I don't see how you /ever/ get the last line with your existing code
|
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Fri Jan 23, 2004 2:49 pm Post subject: Re: High(Array) TQuickRep |
|
|
On 22 Jan 2004 06:16:46 -0800, [email]dieterdebuck (AT) pandora (DOT) be[/email] (dieter) wrote:
| Quote: | It was
for i:=0 to High(Array)
that I used.
It's still very strange to me that it works on
one pc and not on an other.
|
Hmm.. well your OP was different ...
I've got a hunch that this is a matter of 'perception'
- users often report back incorrect information
|
|
| Back to top |
|
 |
Bruce Roberts Guest
|
Posted: Wed Jan 28, 2004 8:36 pm Post subject: Re: High(Array) TQuickRep |
|
|
"dieter" <dieterdebuck (AT) pandora (DOT) be> wrote
| Quote: | Hi,
I have declared a dynamic array,
And with for i:=0 to High(Array)-1 I loop through the array.
For each element of the array i have to print a column on a
Quickrep. When i do this on a pc where Delphi is installed
everything works fine, but when i do this on a customers pc
where Delphi is not installed, i never get to print the
last item in the array?
Does anybody know what the problem might be??
|
Dynamic arrays have a zero starting index, i.e. Low (Array) always = 0. High
(Array) is the index of the last element in the array, i.e. its always 1
less than Length (Array). your loop should probably be
for i := Low (Array) to High (Array) do
Are you really sure that the code works as stated on the development pc?
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|