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 - fputln() write cr/lf and text line to buffered file stream http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fputln()            Write CR/LF and text line to buffered file stream
------------------------------------------------------------------------------
 Declaration
   fileio.hdr

 Syntax
   proc fputln extern
   param       file fStream, ;
         const char cLine

 Arguments
   fStream is the file stream to manipulate.
   cLine is the string to write to the file.

 Return
   None.

 Description
   The fputln() procedure writes cLine to the disk file associated with
   fStream. The file, fStream must have been opened originally in
   append or create mode.

   The carriage-return and line-feed characters are prepended to the output
   string. Therefore, fputln() is similar to:

   ? cLine

 Example
   #define EXAMPLE_FILE
   #include example.hdr

   proc Test_fputln
   vardef
      file fTemp
   enddef
   fopen( fTemp, "test.txt", F_CREATE, F_TEXT ) // open file
   
   fput( fTemp, "device=" )            // these become one line
   fput( fTemp, "c:\dos\himem.sys" )
   
   fputln( fTemp, "files=40" )         // each separate line
   fputln( fTemp, "stacks=9,256" )     // CRLF is in front of text
   
   fwriteln( fTemp, "" )               // write a CRLF
   fwriteln( fTemp, "buffers=8" )      // each separate line
   fwriteln( fTemp, "dos=high,umb" )   // CRLF is after text
   
   fclose( fTemp )                     // close file
   type "test.txt"                     // display file
   erase "test.txt"                    // clean up
   endproc

   proc main
   Test_fputln()
   endproc

See Also: fgetln() fput() fputc() fwriteln()

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