Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>afilewrite() - write an array of strings to a text file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     afilewrite() - write an array of strings to a text file
  Usage:    <logical> = afilewrite(<filename>,<arrayname>)
  Params:   string <filename> - the file to create
            array <arrayname> - the array to write out.

  Returns:  .T. if file created successfully, .F. if error

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

                 declare MYarray[5]

                 MYarray[1] = "this is the first line of text"
                 MYarray[2] = "this is the second line of text"
                 MYarray[3] = "this is some more text"
                 MYarray[4] = "the next to last line of text"
                 MYarray[5] = "this is the last line of text"

                 if !(afilewrite("test.txt",MYarray))
                      ? "Couldn't write file"
                 endif

            At DOS, if you TYPE the file TEST.TXT, it will print
            5 lines of text with each one equal to the contents of
            one array element. You can read the lines of text back
            into MYarray via the afileread("test.txt","MYarray")
            function call.

  Note:     Afilewrite() expects all array elements to be defined.
            If you do not plan to fill all your elements with
            something, initialize all elements with the afill()
            function. All elements must be of type string.

See Also: afileread() amacprint() arrayprint()

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