BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

High(Array) TQuickRep

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
dieter
Guest





PostPosted: Thu Jan 22, 2004 8:42 am    Post subject: High(Array) TQuickRep Reply with 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??
Thx
Dieter
Back to top
J French
Guest





PostPosted: Thu Jan 22, 2004 10:28 am    Post subject: Re: High(Array) TQuickRep Reply with quote



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





PostPosted: Thu Jan 22, 2004 2:16 pm    Post subject: Re: High(Array) TQuickRep Reply with 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.


[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





PostPosted: Fri Jan 23, 2004 2:49 pm    Post subject: Re: High(Array) TQuickRep Reply with quote

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





PostPosted: Wed Jan 28, 2004 8:36 pm    Post subject: Re: High(Array) TQuickRep Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.