Re: For Loop Help



"Craig L" <w1zard10@xxxxxxxxxxxxxxx> writes:

> var image1, image2, image3, image4

If you have any serious number of such variables, you should probably
just use an array:

var image = [];

> To a for loop that changes the variable name so I don't have to list them,
> Like
>
> for (var i = 1; i <= 4; i++) {

image[i] = ...

> }

/L
--
Lasse Reichstein Nielsen - lrn@xxxxxxxxxx
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
.



Relevant Pages

  • Re: The name of script itself
    ... You need this instead if you want to do it in a loop: ... even though he's accessing the array in random order, ... Prev by Date: ...
    (comp.lang.awk)
  • Re: elegant solution for counting runs
    ... has to test (within a loop through the sequence) for the first ... Shift the array by 1 and check if the entries in the new array and ... entries that did match. ... prev) then ...
    (comp.lang.fortran)
  • Muti Dimmed Array Problem
    ... I am trying to create an array that will eventually loop to update ... corresponding record in a database. ... Prev by Date: ...
    (microsoft.public.scripting.vbscript)
  • Re: Buffer overflow Article - CACM
    ... > As for Robert's note about explicit indices, it would be nice to have ... > for E in X loop ... ... No indexing off the end of the array. ... Prev by Date: ...
    (comp.lang.ada)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)