home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / OSLIB101.ZIP / TEST / TEST.PRG < prev   
Encoding:
Text File  |  1998-04-14  |  1.8 KB  |  49 lines

  1. Function Main()
  2.  
  3.    ? "Welcome to OSLib"
  4.    ?
  5.    If OL_IsOS2() .Or. OL_IsMSWin()
  6.       Cls
  7.       ? "Hmm, a " + if( OL_IsOS2(), "OS/2", "MS-Windows" ) + " user eh?"
  8.       ?
  9.       ? "The OS version appears to be " + alltrim( str( OL_OsVerMaj() ) ) + "." + alltrim( str( OL_OsVerMin() ) )
  10.       ?
  11.       ? "Now for some tests. Make sure that we are running in a window and not in"
  12.       ? "full screen mode. Also, you might want to run some kind of CPU meter to"
  13.       ? "watch the CPU usage. Press a key when ready....."
  14.       inkey( 0 )
  15.       Cls
  16.       ? "Ok, we are now sat on a bare inkey( 0 ), the CPU usage should be pretty"
  17.       ? "high. (Press any key when done)"
  18.       inkey( 0 )
  19.       Cls
  20.       ? "Now, wait for a key again but this time use a loop that yields to the"
  21.       ? "OS. This time you should notice that the CPU usage is a lot less."
  22.       ? "(Press any key when done)"
  23.       Do While nextkey() == 0
  24.          OL_Yield()
  25.       EndDo
  26.       InKey() // Munch...
  27.       Cls
  28.       ? "Now, this time, we'll turn on the AutoYield feature and do a simple"
  29.       ? "InKey( 0 ) again. This time you should notice that the CPU usage is"
  30.       ? "higher but that it isn't as bad as when AutoYield is turned off."
  31.       ? "(Press any key when done)"
  32.       OL_AutoYield( .T. )
  33.       InKey( 0 )
  34.       If OL_IsMSWin()
  35.          Cls
  36.          ? "Now for one Windows trick. Make sure we are in a Window and not full screen."
  37.          ? "Then, press any key and I'll make this full screen for you."
  38.          InKey( 0 )
  39.          OL_WinFullScreen()
  40.          Cls
  41.          ? "Here you are, full screen mode (well, if it worked for you <g>)."
  42.       EndIf
  43.    Else
  44.       ? "You don't appear to be running under MS-Windows or OS/2"
  45.       ? "Bye"
  46.    EndIf
  47.  
  48. Return( NIL )
  49.