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 - fileview() browse a text file http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fileview()          Browse a text file
------------------------------------------------------------------------------
 Declaration
   file.hdr

 Syntax
   func logical fileview extern
   param value uint uTop, ;
         value uint uLeft, ;
         value uint uBottom, ;
         value uint uRight, ;
         const char cFile, ;
         value byte bColorText, ;
         value byte bColorBar

 Arguments
   uTop is top row of the display window.
   uLeft is the left column of the display window.
   uBottom the bottom row of the display window.
   uRight is the right column of the display window.
   cFile is the name of the file to display.
   bColorText is the color of the text.
   bColorBar is the color of the navigation bar.

 Return
   A logical indicating if the requested file was successfully displayed.

 Description
   The fileview() function displays a text file on the screen, and allows
   the operator to browse it using the conventional navigation keys. Files
   that do not fit in memory are displayed in part.

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   // simple text file viewer application
   
   proc Test_fileview
   if isempty( argv( 1 ) )
      ? "File Viewer: Please specify a file to view"
   else
      if .not. exist( argv( 1 ) )
         ? "File Viewer: File not found"
      else
         savescreen()
         fill( 0, 0, __max_row, __max_col, BOX_DOUBLE, " ", CYAN_BLACK, ;
            CYAN_BLACK, 0 )
         dispcolor( 0, 1, "[ File Viewer ]", CYAN_BLUE )
         fileview( 1, 1, __max_row - 1, __max_col - 1, argv( 1 ), ;
            CYAN_BLACK, WHITE_BLACK )
         restorearea()
      endif
   endif
   endproc

   proc main
   Test_fileview()
   endproc

See Also: medit()

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