User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 422,924 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,326 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 657 | Replies: 3 | Solved
Reply
Join Date: May 2008
Posts: 11
Reputation: jennifer_48219 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jennifer_48219 jennifer_48219 is offline Offline
Newbie Poster

for loop

  #1  
May 29th, 2008
Hi everyone, I am using the for loop function. I feel that my code is correct but something is wrong. I check for brackets and semicolon and they are in the right places and the right amount.

Can someone look at my code and let me know why it is not displaying/functioning. I am using the decrement operator with the for loop.
This code should make my code look like
0
1
2
etc

 function ForTest()
{
	var OutPut="";	
	FillArray()
	for (var i=Numbers.length; i >= 0; i--)
	{
	OuPut = OutPut + Numbers[i] + "\r";
	} 
	document.frmMain.txtaOutput.value = OutPut;
}
Last edited by jennifer_48219 : May 29th, 2008 at 10:19 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 181
Reputation: Traicey is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 16
Traicey's Avatar
Traicey Traicey is offline Offline
Junior Poster

Re: for loop

  #2  
May 30th, 2008
The problem could be that you have this OuPut = OutPut + Numbers[i] + "\r"; instead of OutPut = OutPut + Numbers[i] + "\r"; the spelling of your output is wrong before the equal sign maybe if you could fix that everything else would be perfect
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Reply With Quote  
Join Date: May 2008
Posts: 11
Reputation: jennifer_48219 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jennifer_48219 jennifer_48219 is offline Offline
Newbie Poster

Re: for loop

  #3  
May 30th, 2008
Thanks Traicey, I did not even notice that until you mention it. I put in the missing letter and it still not working. grrrrr

Originally Posted by Traicey View Post
The problem could be that you have this OuPut = OutPut + Numbers[i] + "\r"; instead of OutPut = OutPut + Numbers[i] + "\r"; the spelling of your output is wrong before the equal sign maybe if you could fix that everything else would be perfect
Reply With Quote  
Join Date: May 2008
Posts: 11
Reputation: jennifer_48219 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jennifer_48219 jennifer_48219 is offline Offline
Newbie Poster

Re: for loop

  #4  
May 30th, 2008
oh my goodness, I feel so dumb. I found out what I was doing wrong. It was in my form. I did not let my form know that ForTest is a function.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 1:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC