home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / bassub / scrnclk.bas < prev    next >
Encoding:
BASIC Source File  |  1987-10-18  |  1.1 KB  |  49 lines

  1.  
  2. '   Subprogram to place a 24 hour clock on screen. This uses
  3. '   FastPrt() from Dave Evers' BASWIND2 to write to the screen,
  4. '   hence it does not effect the cursor or the current COLOR
  5. '   statement.
  6.  
  7.     SUB ScrnClk(CFore%, CBack%, CLoc$) STATIC
  8.  
  9.         IF INSTR(CLoc$,":") THEN
  10.             Row% = VAL(LEFT$(CLoc$,2))
  11.             Col% = VAL(RIGHT$(CLoc$,2))
  12.             IF Col% > 70 THEN
  13.                 Col% = 70
  14.             END IF
  15.         ELSE
  16.             CLoc% = VAL(Cloc$)
  17.             SELECT CASE CLoc%
  18.                 CASE 1, 2, 3
  19.                     Row% = 1
  20.                 CASE 4, 5, 6
  21.                     Row% = 25
  22.                     CLoc% = CLoc% - 3
  23.                 CASE ELSE
  24.                     Row% = 25
  25.                     Cloc% = 2
  26.             END SELECT
  27.             Col% = (CLoc% * 35) - 35
  28.                 IF Col% = 0 THEN
  29.                     Col% = 1
  30.                 END IF
  31.         END IF
  32.         Attr% = (CBack% AND 7) * 16 + CFore%
  33.         Clock$ = CHR$(32) + TIME$ + CHR$(32)
  34.         CALL FastPrt(Clock$, Row%, Col%, Attr%)
  35.  
  36.     END SUB
  37.  
  38. '   Initialize timer to 1 second intervals for GOSUB to occur.
  39. '   Must use Check Between Statements option when compiling for
  40. '   best result.
  41.         ON TIMER (1) GOSUB CallClock
  42.         TIMER ON
  43.  
  44. '   This is the GOSUB routine used to call the subprogram.
  45.         CallClock:
  46.             CALL SCRCLK(15,1,"02:65")
  47.         RETURN
  48.  
  49.