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_create()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
b_create()


Syntax:     b_create(<expC>)

Purpose:    Create a text file or truncate an existing file to 0 bytes

Arguments:  <expC> is the new filename

Returns:    A numeric value

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)+CR) )
   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