View Full Version : How do you create a loop?


pv-chan
03-30-2005, 12:04 AM
I have a text area and i want to create a loop (i THINK, i'm really not positive >.<; ) but i want to put a graph in the textarea of "*" (stars) i want 1 star per every 500 and i'm getting my number from a model that i've already created above, it's number for the first year is 9915.

I want one line of stars to appear for each year, so i know i need count=0 and i need "/n" somewhere but i'm just so confused as to what count means in the first place and how to work a loop,

loops litterally throw me for a loop (:P pkay i'll refraine from doing the bad pun thing)

here's the link to what i have so far without the loop, i know this is a confusing questions, but i think i just need to be pointed in the right direction on this one. i'm completely lost >.<
Thanks peoples!
Link: http://www.geocities.com/vegeta5555//mousepop.html

~PV

pv-chan
03-31-2005, 03:33 AM
Okay, so I've been able to determine that it's not actually a loop, but no one can figure out what's wrong with my code, it should work but it just doesn't.
i'm using this code

if ( document.mices.owlgraph.checked )
{

document.mices.display.value = document.mices.display.value + "\n" + years;
}

for ( var count = 1; count <= mousepop/500; count =count +1 )
{

document.mices.display.value = document.mices.display.value + "*";

}

Can anyone see a problem, it keeps saying that "document.mices.display" is null or not an object, but it is, display is the name of my textarea where i want the stars to display in??
~PV