<!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.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<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>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>hyper</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=walter@torres.ws href="mailto:walter@torres.ws">Walter Torres</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu 
  href="mailto:javascript@LaTech.edu">[JavaScript List]</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, May 24, 2003 1:10 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Javascript] variable 
  undefined problem</DIV>
  <DIV><BR></DIV>sure, increament *after* you get the item needed.<BR><BR>You 
  are doing it *before*<BR><BR>This means you will *never* get 'item0' and you 
  will always ask for ONE past<BR>the end.<BR><BR>walter<BR><BR><BR>&gt; 
  -----Original Message-----<BR>&gt; From: <A 
  href="mailto:javascript-bounces@LaTech.edu">javascript-bounces@LaTech.edu</A><BR>&gt; 
  [mailto:javascript-bounces@LaTech.edu]On Behalf Of <A 
  href="mailto:hypersdc@cox.net">hypersdc@cox.net</A><BR>&gt; Sent: Friday, May 
  23, 2003 11:48 AM<BR>&gt; To: [JavaScript List]<BR>&gt; Subject: Re: 
  [Javascript] variable undefined problem<BR>&gt;<BR>&gt;<BR>&gt; Ok. But how 
  should I fix that. Any recommendations?<BR>&gt; I'm trying to get the variable 
  values from the external file<BR>&gt; without knowing<BR>&gt; how many items 
  are in the list.<BR>&gt;<BR>&gt; Thanks<BR>&gt; ----- Original Message 
  -----<BR>&gt; From: "Rodney Myers" &lt;<A 
  href="mailto:rodney@aflyingstart.net">rodney@aflyingstart.net</A>&gt;<BR>&gt; 
  To: "[JavaScript List]" &lt;<A 
  href="mailto:javascript@LaTech.edu">javascript@LaTech.edu</A>&gt;<BR>&gt; 
  Sent: Saturday, May 24, 2003 2:10 AM<BR>&gt; Subject: Re: [Javascript] 
  variable undefined problem<BR>&gt;<BR>&gt;<BR>&gt; &gt; Hello,<BR>&gt; 
  &gt;<BR>&gt; &gt; As the while loop starts with a valid itemCheck variable it 
  should cycle<BR>&gt; &gt; until the last valid variable.<BR>&gt; &gt; But 
  inside the loop you have<BR>&gt; &gt;<BR>&gt; &gt; x = "item" + i;<BR>&gt; 
  &gt; itemCheck =eval(x);<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; if itemN was 
  the last valid item, and so permitted entry to the loop<BR>&gt; &gt; the N+1 
  is guaranteed to be undefined.<BR>&gt; &gt;<BR>&gt; &gt; hth<BR>&gt; 
  &gt;<BR>&gt; &gt; Rodney<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; <A 
  href="mailto:hypersdc@cox.net">hypersdc@cox.net</A> wrote:<BR>&gt; 
  &gt;<BR>&gt; &gt; &gt;I'm having problems with a variable undefined 
  error.<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;I'm grabbing a set of variables from 
  a file (.js file). I'm cycling<BR>&gt; through<BR>&gt; &gt; &gt;the variables 
  with a while statement. The problem I'm having<BR>&gt; is the last<BR>&gt; 
  &gt; &gt;variable is getting an undefined. How can I fix the code so<BR>&gt; 
  this doesn't<BR>&gt; &gt; &gt;happen.<BR>&gt; &gt; &gt;<BR>&gt; &gt; 
  &gt;//Start Code:<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;var i = 0;<BR>&gt; &gt; 
  &gt;var itemCheck = item0;<BR>&gt; &gt; &gt;while(window.itemCheck)<BR>&gt; 
  &gt; &gt;{<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;&nbsp; document.write("&lt;A 
  HREF=" + itemCheck + "&gt;" + itemCheck +<BR>&gt; "&lt;BR&gt;&lt;/A&gt;" 
  );<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;&nbsp;&nbsp; i++;<BR>&gt; &gt; &gt;x = 
  "item" + i;<BR>&gt; &gt; &gt;itemCheck =eval(x);<BR>&gt; &gt; &gt;<BR>&gt; 
  &gt; &gt;if (typeof eval(x) == 'undefined')<BR>&gt; &gt; 
  &gt;&nbsp;&nbsp;&nbsp; alert('2 Undefined');<BR>&gt; &gt; &gt;else<BR>&gt; 
  &gt; &gt;&nbsp;&nbsp;&nbsp; alert('2 okay');<BR>&gt; &gt; &gt;itemCheck 
  =eval(x);<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;}<BR>&gt; &gt; 
  &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;//End code<BR>&gt; &gt; &gt;<BR>&gt; 
  &gt; &gt;//js content<BR>&gt; &gt; &gt;var item0 = "name 1";<BR>&gt; &gt; 
  &gt;var item1 = "name 2";<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;//end js file 
  content<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;Thanks in advance<BR>&gt; &gt; 
  &gt;<BR>&gt; &gt; &gt;_______________________________________________<BR>&gt; 
  &gt; &gt;Javascript mailing list<BR>&gt; &gt; 
  &gt;Javascript@LaTech.edu<BR>&gt; &gt; 
  &gt;https://lists.LaTech.edu/mailman/listinfo/javascript<BR>&gt; &gt; 
  &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; --<BR>&gt; 
  &gt;<BR>&gt; &gt; PS. I now have resale rights for Mike Chen's<BR>&gt; &gt; 
  BizAutomator. If you have to answer routine<BR>&gt; &gt; email queries from 
  your sites or mailings then<BR>&gt; &gt; you will find this simple-to-use 
  program invaluable.<BR>&gt; &gt; <A 
  href="http://www.BizAutomator.co.uk">http://www.BizAutomator.co.uk</A><BR>&gt; 
  &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; 
  &gt;<BR>&gt; &gt;<BR>&gt; &gt; 
  _______________________________________________<BR>&gt; &gt; Javascript 
  mailing list<BR>&gt; &gt; <A 
  href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</A><BR>&gt; &gt; <A 
  href="https://lists.LaTech.edu/mailman/listinfo/javascript">https://lists.LaTech.edu/mailman/listinfo/javascript</A><BR>&gt;<BR>&gt; 
  _______________________________________________<BR>&gt; Javascript mailing 
  list<BR>&gt; <A 
  href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</A><BR>&gt; <A 
  href="https://lists.LaTech.edu/mailman/listinfo/javascript">https://lists.LaTech.edu/mailman/listinfo/javascript</A><BR><BR><BR>_______________________________________________<BR>Javascript 
  mailing list<BR><A 
  href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</A><BR><A 
  href="https://lists.LaTech.edu/mailman/listinfo/javascript">https://lists.LaTech.edu/mailman/listinfo/javascript</A></BLOCKQUOTE></BODY></HTML>