home *** CD-ROM | disk | FTP | other *** search
- /*┌────────────────────────────────────────────────────────────────────────┐
- │ Program Name: TEST.PRG Copyright: Gallagher Computing Corp. │▐
- │ Date Created: 08/18/92 Language: Clipper 5.0 │▐
- │ Time Created: ******** Author: Kevin S Gallagher .PRG │▐
- │ c:/brief/clipper.src Author: Ben Echols .ASM │▐
- │ │▐
- │ This clock function could be called directly, using the two function │▐
- │ calls within TICKER.OBJ or with error-checking values returned. │▐
- │ It is presented here in one of many ways to install/remove it. │▐
- │ │▐
- │ If you like this function please send $5.00 (not required but helpful) │▐
- │ MASM source code send $10.00 │▐
- │ Comments GOOD/BAD are always welcomed! │▐
- │ │▐
- │ Gallagher Computing Corp. │▐
- │ 660 Woodward Drive │▐
- │ Huntingdon Valley PA. 19006 │▐
- │ COMPUSERVE CIS 70034,2313 │▐
- │ │▐
- │ Enjoy! │▐
- └────────────────────────────────────────────────────────────────────────┘▐
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
- */
-
- #include "include1.ch"
-
- function test
- local oldcur := setcursor( 0 )
- local SaveFullScreen(), x
- Panel( .T. )
- CLOCK ROW 0 COL 71 // Install clock
- do while LASTKEY() != K_ESC
- DoWait( 0 )
- enddo
- CLOCK x ROW 99 COL 99 // remove it with errolevel
- RestFullScreen()
- setcursor( 1 )
- @ 0,0 say PADR("CLOCKS RETURN CODE "+LTRIM(STR( x )),80) color "W+/B"
- @ 3,0 say ""
- return nil
-
- function MCLOCK(nRow,nCol)
- local nErrLevel := 102
- *
- * You do not need to call the clock like this
- * unless an errorlevel is desired
- *
- do case
- case valtype(nRow) = "C" .OR. valtype(nCol) = "C"
- return 101
- case nRow = 99 .OR. nCol = 99
- nErrLevel:= BK_TICKREM()
- case nCol >= 0 .AND. nCol <= 71 .AND. nRow >= 0 .AND. nRow <= 24
- nErrLevel := BK_TICKINS(nRow, nCol)
- endcase
- if nErrLevel=97 .OR. nErrLevel=1
- alert(" FATAL ERROR ",{" REBOOT NOW "},"W+/B")
- endif
- return nErrLevel
-
- function DoWait(wTime)
- local key, cblock
- do case
- case pcount() == 0
- key:=inkey()
- case wTime == NIL .and. pcount() == 1
- key:=inkey(0)
- otherwise
- key:=inkey(wTime)
- endcase
- cblock:=Setkey(key)
- if cblock !=NIL ; eval(cblock,procname(1),procline(1), NIL) ; endif
- return key
-
- function HELP
- local SaveFullScreen()
- local oldcolor := setcolor("N/BG")
- BoxShad( 3, 3, MAXROW()-3, MAXCOL()-4, "W+/BG" )
- @ 4,5 say "The clock presented here was designed to resemble the clock that is"
- @ 5,5 say "used in BRIEF Programmer Editor (c) SolutionSystems. It was created"
- @ 6,5 say "with Microsoft MASM 6.0, which is an event driven clock. If you do"
- @ 7,5 say "not uninstall the clock prior to exiting the application, then the"
- @ 8,5 say "computer system will surely CRASH!"
- @ 9,5 say "You can parse the return errorlevel from the clock (see .prg file):"
- @10,5 say "Install BK_TICKINS( <nRow>, <nCol> ) --> nErrorLevel"
- @11,5 say "Remove BK_TICKREM() --> nErrorLevel"
- @12,5 say "nErrorLevel codes:"
- @13,5 say " 100 successful"
- @14,5 say " 99 col out of range // BK_TICKINS() only"
- @15,5 say " 98 row out of range // BK_TICKINS() only"
- @16,5 say " 97 already installed/not reinstalled"
- @17,5 say "<nRow> 0-24 row where clock is positioned"
- @18,5 say "<nCol> 0,72 col where clock is positioned"
- @19,5 say "The clock uses the current color at <nRow>, <nCol>"
- @20,5 say "Notice the top bar color has change, as did the clock color!"
- @00,0 say PADR(" ",80) color "GR+/RB"
- @24,0 say PADR(" Press ESC to exit or any key to exit HELP",80) color "GR+/RB"
- inkey( 0 )
- setcolor( oldcolor )
- RestFullScreen()
- return nil
-
- init function haha
- *******************************************
- *▒▒ prevent pre-mature exiting of demo ▒▒▒*
- *******************************************
- setcancel( .F. )
- return nil
-