<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=525081613-29052003>How
about using something like this? I changed itemCheck to be a boolean
flag. If you didn't have an item0, that would have raised an error.
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=525081613-29052003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>var i = 0;<BR>var itemCheck = true;
<BR>while(window.itemCheck) <BR>{ <BR> x = "item" + i;<BR> try
{<BR> itemCheck =eval(x);<BR> document.write("<A
HREF=" + itemCheck + ">" + itemCheck + "<BR></A>" );<BR>
i++; <BR> }<BR> catch (e) {<BR> itemCheck =
false;<BR> }<BR>} </FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> hypersdc@cox.net
[mailto:hypersdc@cox.net]<BR><B>Sent:</B> Wednesday, May 28, 2003 12:31
AM<BR><B>To:</B> [JavaScript List]<BR><B>Subject:</B> Re: [Javascript]
variable undefined problem<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>I still have the increment and variable undefined
problem.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here is my latest revision of the
code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>var i = 0;<BR>var itemCheck = item0;
<BR>while(window.itemCheck) <BR>{ </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>x = "item" + i;<BR>itemCheck
=eval(x);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>document.write("<A HREF=" + itemCheck + ">"
+ itemCheck + "<BR></A>" );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> i++; <BR>} </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any help would be appreciated as this one is
driving me crazy.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The .js file that I'm getting the variables from
has 2 items in it currently. </FONT></DIV>
<DIV><FONT face=Arial size=2>var item0 = "files/file1.html";<BR>var item1 =
"files/file2.html";</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Later it will have an unknown amount (that's why
I need the while statement).</FONT></DIV></BLOCKQUOTE></BODY></HTML>