Re: a problem in my program in pascal



On 11 Oct 2006 05:23:53 -0700, gilevgi@xxxxxxxxx waffled on about
something:


I want to write the pattern " for i:=1 to a[i] do" n times (n is
variable), that is,


for b[1]:=1 to a[1] do
for b[2]:=1 to a[2] do
for b[3]:=1 to a[3] do
for b[4]:=1 to a[4] do
.........
..........
.........
for b[n]:=1 to a[n] do
something here.


in this writing n is a variable. therefore I can not write what i want.
can you say how can i write the above structure using "repeat-until" or
"while" patterns?

thanks in advance.

Never before has half a dozen lines of code instilled such a sense of
terror in me!

Even if a[1],a[2]...etc etc only contain the value 100, your loop
could be going for days!

Iteration=Max a[] element value ^ n

What are you actually trying to do? (Please step back and describe the
broader function of you code).

Dodgy.
--
MUSHROOMS ARE THE OPIATE OF THE MOOSES
.



Relevant Pages

  • Re: Lack of purple prose.
    ... MUSHROOMS ARE THE OPIATE OF THE MOOSES ... It's quite a slow paced tune, a sad one (although being a flash muso ...
    (uk.local.essx)
  • Re: Lack of purple prose.
    ... Actually, Essex girls can be found all over the country, lol. ... MUSHROOMS ARE THE OPIATE OF THE MOOSES ...
    (uk.local.essx)
  • Re: Lack of purple prose.
    ... MUSHROOMS ARE THE OPIATE OF THE MOOSES ... more sense if the words were underneath the chords... ...
    (uk.local.essx)
  • Re: For all........old regulars......past & present.
    ... Your Good Buddy, Guide and Mentor, ... MUSHROOMS ARE THE OPIATE OF THE MOOSES ...
    (uk.local.essx)
  • Re: ?
    ... I'll push you in the fishing lake if it'll help! ... >> MUSHROOMS ARE THE OPIATE OF THE MOOSES ...
    (uk.local.essx)