// Check correct time format hh:mm:ss for V[mytime] // Put different parts of hh:mm:ss into separate variables Set V[hh] "&V[mytime](1-2)" // hh Set V[sep1] "&V[mytime](3-3)" // : Set V[mm] "&V[mytime](4-5)" // mm Set V[sep2] "&V[mytime](6-6)" // : Set V[ss] "&V[mytime](7-8)" // ss // only hh specified? then assume hh:00 if V[hh] and not V[sep1] Set V[mytime] "&V[hh]:00" Set V[sep1] ":" Set V[mm] "00" endif // only hh:mm specified? then assume hh:mm:00 if V[mm] and not V[sep2] Set V[mytime] "&V[hh]:&V[mm]:00" Set V[sep2] ":" Set V[ss] "00" endif // check separators ':' in hh:mm:ss if not V[sep1=:] or not V[sep2=:] Return "E: Time &V[mytime] Please specify a time in the format hh:mm:ss" -statusline endif // Transform hh mm ss into 2 digits each Set V[hh_num] &V[hh] + 100 Set V[hh_num] "&V[hh_num](2-3)" Set V[mm_num] &V[mm] + 100 Set V[mm_num] "&V[mm_num](2-3)" Set V[ss_num] &V[ss] + 100 Set V[ss_num] "&V[ss_num](2-3)" // Check hh if not V[hh=&V[hh_num]] or V[hh_num>23] Return "E: Time &V[mytime] Please specify an hour between 00 and 23" -statusline endif // Check mm if not V[mm=&V[mm_num]] or V[mm_num>59] Return "E: Time &V[mytime] Please specify minutes between 00 and 59" -statusline endif // Check ss if not V[ss=&V[ss_num]] or V[ss_num>59] Return "E: Time &V[mytime] Please specify seconds between 00 and 59" -statusline endif