--------- Face Lift --------- Don't you hate the way that Qbasic does everything in Military Time? Well, in this issues Face Lift, I have a alarm program that not only converts from military time to regular time, but also allows you to type in a time in almost ANY format, and it will convert it to military time! DECLARE FUNCTION FullTime$ () DECLARE FUNCTION FullToMil$ () PRINT PRINT "Acidus Sleeper VER 1.0" PRINT "Current Time is: "; FullTime$ wake$ = FullToMil$ PRINT PRINT "Sleep Mode Active..." SLEEP 3 CLS DO LOOP UNTIL wake$ = TIME$ DO SOUND (1000), .1 LOOP UNTIL LEN(INKEY$) PRINT "Good morning" SYSTEM FUNCTION FullTime$ t$ = TIME$ hour% = VAL(LEFT$(t$, 2)) tt$ = "am" IF hour% = 0 THEN hour% = 12 IF hour% > 12 THEN hour% = hour% - 12: tt$ = "pm" FullTime$ = LTRIM$(STR$(hour%)) + MID$(t$, 3, 3) + tt$ END FUNCTION FUNCTION FullToMil$ 1 PRINT PRINT "Please type in when you want to wake up (hh:mm)" LINE INPUT in$ half$ = UCASE$(RIGHT$(in$, 2)) IF LEN(in$) < 4 OR LEN(in$) > 5 THEN BEEP PRINT "Invalid time must be (hh:mm)" GOTO 1 END IF OneToNine% = 0 hour$ = LEFT$(in$, 2) IF RIGHT$(hour$, 1) = ":" THEN hour$ = LEFT$(hour$, 1) hours% = VAL(hour$) IF hours% < 1 OR hours% > 12 THEN BEEP PRINT PRINT "Invalid Time: Must be in 12 o'clock format (hh:mm)" GOTO 1 END IF half% = 0 2 PRINT PRINT "AM or PM" LINE INPUT half$ 3 test1% = LEN(half$) IF test1% <> 2 THEN GOTO 2 half$ = UCASE$(half$) IF half$ <> "AM" THEN IF half$ <> "PM" THEN GOTO 2 END IF END IF MilHour$ = "" IF half$ = "PM" THEN MilHours$ = STR$(hours% + 12) ELSE MilHours$ = STR$(hours%) END IF 'trim off spaces MilHours$ = RTRIM$(LTRIM$(MilHours$)) IF MilHours$ = "12" AND half$ = "AM" THEN MilHours$ = "00" min$ = (RIGHT$(in$, 2)) FullToMil$ = MilHours$ + ":" + min$ + ":00" END FUNCTION -------------------------------------------------------------------------------- This tutorial originally appeared in the QBasic Developers Forum, Issue #4. This was written by Lord Acidus.