Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- MICROSYS C & Clipper Functions - <b>b_writline()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
b_writline()


Syntax:     b_writline(<expN1>,<expN2>)

Purpose:    Write a line of text to a file

Arguments:  <expN1> is the file handle returned by b_open()

            <expN2> is the text to write

Returns:    A Numeric Value

Notes:      b_writline() returns the number of bytes actually written

Library:    MICROSYS.LIB

----------------------------------- Example ----------------------------------

   CR       := chr(13)+chr(10)
   nHandle1 := b_open("myfile.txt")
   nHandle2 := b_create("junk.txt")

   if( nHandle1 == -1 )
       qout("Unable to open myfile.txt!")
       retu(.f.)
   endi

   if( nHandle2 == -1 )
       b_close(nHandle1)
       qout("Unable to create junk.txt!")
       retu(.f.)
   endi

   while( !b_eof(nHandle1) )
       b_writeline(nHandle2, b_readline(nHandle1) )
   endd

   qout("myfile.txt! written to junk.txt!")

   b_close(nHandle1)
   b_close(nHandle2)
   retu(.t.)

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