home *** CD-ROM | disk | FTP | other *** search
-
- ***************************************************************
- * Program: WinCB.prg
- * Author : P.L. Olympia, Platinum Software International
- * Purpose: Demonstrates use of CodeBase window functions in
- * : a Force program. Example derived from CodeBase doc
- * :
- * Syntax : C>wincb
- * :
- * Notes : From DBMS Set Expert On column, 07/91
- * : Sample link:
- * : Tlink wincb+f:\force\lib\turboc,,,f:\force\lib\force ;
- * : f:\force\lib\t4 d:\turboc\lib\emu ;
- * : d:\turboc\lib\mathl d:\turboc\lib\cl
- ***************************************************************
-
- #include io.hdr
- #include string.hdr
-
- *-- Define CodeBase Window Functions
-
- FUNCTION INT W4Define PROTOTYPE
- PARAMETERS VALUE INT top_row, ;
- VALUE INT left_col,;
- VALUE INT bot_row, ;
- VALUE INT right_col
-
- PROCEDURE W4Border PROTOTYPE
- PARAMETERS CHAR( 8 ) box_chars,;
- VALUE LONG attrib
-
- PROCEDURE W4Attribute PROTOTYPE
- PARAMETERS VALUE LONG attrib
-
- PROCEDURE W4Activate PROTOTYPE
- PARAMETERS VALUE INT win_ref
-
- PROCEDURE W4Deactivate PROTOTYPE
- PARAMETERS VALUE INT win_ref
-
- PROCEDURE W4Close PROTOTYPE
- PARAMETERS VALUE INT win_ref
-
- PROCEDURE W4Centre PROTOTYPE
- PARAMETERS VALUE INT row,;
- CHAR string
-
- PROCEDURE W4Popup PROTOTYPE
-
- PROCEDURE setup_turboc PROTOTYPE && Force
-
- *-- Here is the program
-
- PROCEDURE Force_Main
- VARDEF
- INT win_ref
- CHAR( 8 ) win_box
- CHAR win_msg
- ENDDEF
-
- SETUP_TURBOC
-
- win_msg = "Hello World"
- win_box = "══║║╔═╚╝╗"
-
- win_ref = W4Define(5, 5, 20, 60) && Define window
- W4Attribute( 23 ) && window attribute
- W4Border( win_box, 23 ) && window border
- W4Popup() && make popup
- W4Activate( win_ref ) && activate window
- W4Centre( 1, win_msg ) && write centered msg
- GET_KEY() && wait for key press
- W4Deactivate( win_ref ) && deactivate window
- W4Close( win_ref ) && close it
-
- ENDPRO
-
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=