Stuck in a loop (I wish)

Stuck in a loop (I wish)

 Hi all, apologies for the pun.

I have stateless form with a button that generates new appointment slots in another table.  User enters a date, and a start time and end time, and date, length of appointments (X minutes) and presses Generate.  I want the routine to start with the start time and keep creating appointments in the other table X minutes apart until the appointment time equals stop time. For each loop, it needs to create a record in other table with the appointment time (last appointment time+X, date, and Appointment name set to AVAILABLE. 

I am not understanding how to loop this routine until the stop time is reached without using WHILE.  I can't make sense of the forum workarounds could be used with dates.  I'm missing something, probably because I am new to writing functions and it sounds like that is where the answer lies.

Gosh, I'm sorry to be so dumb about this, but can someone help? 

Each press of the "generate" button will be creating between 12 and 48 new appointments, probably no more.  The start and end times will vary.

I shared the application to support here:  http://creator.zoho.com/stressrecess/form/315/edit/.

The stateless form is Generate_Appointments and it is creating records in TestAppointments

If any other friend wants a look, let me know so i can share it to you.  Gaev if you are out there, it looks like you have tackled this a lot so maybe you can help.

Devorah