<!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?&nbsp; I changed itemCheck to be a boolean 
flag.&nbsp; If you didn't have an item0, that would have raised an error.&nbsp; 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=525081613-29052003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2>var i = 0;<BR>var itemCheck = true; 
<BR>while(window.itemCheck) <BR>{ <BR>&nbsp;&nbsp;x = "item" + i;<BR>&nbsp;try 
{<BR>&nbsp;&nbsp;itemCheck =eval(x);<BR>&nbsp; &nbsp;document.write("&lt;A 
HREF=" + itemCheck + "&gt;" + itemCheck + "&lt;BR&gt;&lt;/A&gt;" );<BR>&nbsp; 
&nbsp;i++; <BR>&nbsp;}<BR>&nbsp;catch (e) {<BR>&nbsp;&nbsp;itemCheck = 
false;<BR>&nbsp;}<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>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Here is my latest revision of the 
  code:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>var i = 0;<BR>var itemCheck = item0; 
  <BR>while(window.itemCheck) <BR>{ </FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>x = "item" + i;<BR>itemCheck 
  =eval(x);</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>document.write("&lt;A HREF=" + itemCheck + "&gt;" 
  + itemCheck + "&lt;BR&gt;&lt;/A&gt;" );</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp; i++; <BR>} </FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</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>