for loops? not for each though

for loops? not for each though

I wanted to know whether deluge could use for loops in them... and if there was something that could give me the equivalent of syntax's in java.. cuze know the most about that language..

somethign like the normal..
for (int i = 0; i < somenum; i++)
{}

for my quiz application.. i would like it to compare values to a list of answers in the database without typing the same thing for each question..
the public apps "quiz" application works but it only has 5 questions or something...
what if i wanted a custom amount, specifically 40..

so is there a way to do something like this?

there is a form called classwork
student_ID is to distinguish students and is a private field
the id of 0 means that it contains the correct answers

correctAnswers = Classwork [Student_ID == 0];
int maxQuestionID = any number but lets say 40
for (int i = 0; i < maxQuestionID; i++)
{
if (input.Question_i == correctAnswers.Questions_i)
Num_Of_Correct ++;
Correct = Correct + Question_i;
//correct is a string that tells u which answers are right
}

basically use "i" as an increment that can change the column name because each answer from 1-40 or the max is going to be a separate field??

unless there is an easier way..i can't really think =(
thanks.