home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / dbms_mag / 9107 / olympia1 < prev    next >
Text File  |  1991-05-20  |  2KB  |  79 lines

  1.  
  2. ***************************************************************
  3. * Program: WinCB.prg
  4. * Author : P.L. Olympia, Platinum Software International
  5. * Purpose: Demonstrates use of CodeBase window functions in
  6. *        :  a Force program. Example derived from CodeBase doc
  7. *        : 
  8. * Syntax : C>wincb
  9. *        :
  10. * Notes  : From DBMS Set Expert On column, 07/91
  11. *        : Sample link:
  12. *        : Tlink wincb+f:\force\lib\turboc,,,f:\force\lib\force ;
  13. *        :    f:\force\lib\t4 d:\turboc\lib\emu ;
  14. *        :    d:\turboc\lib\mathl d:\turboc\lib\cl
  15. ***************************************************************
  16.  
  17. #include io.hdr
  18. #include string.hdr
  19.  
  20. *-- Define CodeBase Window Functions
  21.  
  22. FUNCTION INT W4Define PROTOTYPE
  23.   PARAMETERS VALUE INT top_row, ;
  24.              VALUE INT left_col,;
  25.              VALUE INT bot_row, ;
  26.              VALUE INT right_col
  27.  
  28. PROCEDURE W4Border PROTOTYPE
  29.   PARAMETERS       CHAR( 8 ) box_chars,;
  30.              VALUE LONG attrib
  31.  
  32. PROCEDURE W4Attribute PROTOTYPE
  33.   PARAMETERS VALUE LONG attrib
  34.  
  35. PROCEDURE W4Activate PROTOTYPE
  36.   PARAMETERS VALUE INT win_ref
  37.  
  38. PROCEDURE W4Deactivate PROTOTYPE
  39.   PARAMETERS VALUE INT win_ref
  40.  
  41. PROCEDURE W4Close PROTOTYPE
  42.   PARAMETERS VALUE INT win_ref
  43.  
  44. PROCEDURE W4Centre PROTOTYPE
  45.   PARAMETERS VALUE INT  row,;
  46.                    CHAR string
  47.  
  48. PROCEDURE W4Popup PROTOTYPE
  49.  
  50. PROCEDURE setup_turboc PROTOTYPE    && Force
  51.  
  52. *-- Here is the program
  53.  
  54. PROCEDURE Force_Main
  55.   VARDEF
  56.     INT        win_ref
  57.     CHAR( 8 )  win_box
  58.     CHAR       win_msg
  59.   ENDDEF
  60.  
  61.   SETUP_TURBOC
  62.  
  63.   win_msg = "Hello World"
  64.   win_box = "══║║╔═╚╝╗"
  65.  
  66.   win_ref = W4Define(5, 5, 20, 60)   && Define window
  67.   W4Attribute( 23 )                  && window attribute
  68.   W4Border( win_box, 23 )            && window border
  69.   W4Popup()                          && make popup
  70.   W4Activate( win_ref )              && activate window
  71.   W4Centre( 1, win_msg )             && write centered msg
  72.   GET_KEY()                          && wait for key press
  73.   W4Deactivate( win_ref )            && deactivate window
  74.   W4Close( win_ref )                 && close it
  75.  
  76. ENDPRO
  77.  
  78. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  79.