ID:276472
 
I'm studying java currently and I'm having a slight problem. How would I call the program over again just like procs in Byond? Lets say I make a addition "proc". How could I call the whole addition "proc" over again within the same program?
I could help if you used java terms. Don't use DM terms to describe Java please, it's confusing... but maybe you want this:

NOTE: Since this is in a DM window, I may have missed some errors... It's not perfect. I still need to get JPadPro at home.
//Here....  
import TerminalIO.KeyboardReader;//Input KeyboardReader if you have it to use this

public class LoopProgram
{
int loop_num = 1;
KeyboardReader Input;
public static void main (String args[])
{
KeyboardReader Input = new KeyboardReader();//If you don't have KeyboardReader, get it. it makes things easy
System.out.println("Enter the number of times you wish to execute");//ask question
loop_num = Input.ReadInt();//get answer

while(loop_num > 0)
{
loop_num --;//take one off loop_num
Tester(loop_num);//execute Tester(int)
}
}
//***********************************************************
public static Tester(int number)
{
System.out.println("The loop will execute " + number + " more times.");//Ticks off number of times it will execute
//Put the code you wish to repeat here
}

}


Is that what you wanted?

--Vito