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>afileread() - load a text file into an array</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     afileread() - load a text file into an array
  Usage:    <logical> = afileread(<filename>,<arrayname>)
  Params:   string <filename> - the text file to read
            string <arrayname> - the arrayname to create

            the array created is declared public. Remember to
            send the name of the array as a string variable.

  Returns:  .T. if file read in successfully, .F. if not or
            the file was empty.

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

                 fname = "menu.txt"
                 aname = "menuarray"

                 if ! (afileread(fname,aname))
                      ? "Error reading printer definition"
                      return
                 endif

                 m_choice(10,35,27,65,menuarray)

  Note:     This function is an example function contained on the
            source disk in the file c_afiler.prg.

  Hint:     While the apparent use of this function seems to be
            to save/restore string arrays to disk, much more power
            can be wrung from this function. One good use is to keep
            array definitions for menus, dbedits(), mx_dbfview(),
            m_prompt(), m_choice(), achoice() on disk. Keep the
            text of the array on disk, read it into the array with
            afileread(), then use the array in one of the array
            functions. When you need to modify the contents of the
            array, you can have memoedit() edit the array definition
            file without having to recompile your application.


See Also: amacprint() arrayprint() m_choice()

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