Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - handleready() test a device handle for read or write http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 handleready()       Test a device handle for read or write
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   func logical handleready extern
   param value uint uHandle, ;
         value uint uMode

 Arguments
   uHandle is the handle of the device to manipulate.
   uMode specifies the direction mode for the handle.

 Return
   A logical indicating if the device handle is available for the operation.

 Description
   This function tests if the specified device handle is available for the
   mode specified in uMode. The following definitions for the uMode
   parameter are found in io.hdr:

   #define HR_INPUT  6
   #define HR_OUTPUT 7

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc Test_handleready
   // Check STDIN, STDOUT, and STDPRN. STDIN is open for read only,
   // the others are open for write only.
   ? handleready( STD_IN,  HR_INPUT )    // .t.
   ? handleready( STD_IN,  HR_OUTPUT )   // .f.
   ?
   ? handleready( STD_OUT, HR_INPUT )    // .f.
   ? handleready( STD_OUT, HR_OUTPUT )   // .t.
   ?
   ? handleready( STD_ERR, HR_INPUT )    // .f.
   ? handleready( STD_ERR, HR_OUTPUT )   // .t.
   ?
   ? handleready( STD_AUX, HR_INPUT )    // .f.
   ? handleready( STD_AUX, HR_OUTPUT )   // .f.
   ?
   ? handleready( STD_PRN, HR_INPUT )    // .f.
   ? handleready( STD_PRN, HR_OUTPUT )   // .t.
   endproc

   proc main
   Test_handleready()
   endproc

See Also: DOS handle table fbopen()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson