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 - mgetln() return a line of text from a memo http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 mgetln()            Return a line of text from a memo
------------------------------------------------------------------------------
 Declaration
   memo.hdr

 Syntax
   proc mgetln extern
   param memo mMemoField, ;
         char cInputBuffer

 Arguments
   mMemoField is the memo to operate on.
   cInputBuffer is a char variable to accept data from the memo.

 Return
   None.

 Description
   The mgetln() procedure returns the current line of ASCII text from
   mMemoField. If the mMemoField is at EOF, then a NULL string is returned.

   Characters are read from mMemoField until a carriage return and line-feed
   are encountered, which are each stripped from cInputBuffer. cInputBuffer
   is NULL terminated.

   The cInputBuffer buffer must be large enough to accommodate the entire
   line of text because mgetln() does not check the size of the destination
   buffer.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   proc Test_mgetln
   // Print a copy of a memo
   vardef
      char( 80 ) cMemo
   enddef
   open sTest                             // open database
   do while .not. aeof( sTest )           // loop through records
      mopen( sTest->notes, MO_READ )      // open memo field for current record
      do while .not. meof( sTest->notes )
         mgetln( sTest->notes, cMemo )    // get memo lines
         if .not. isempty( cMemo )
            ? recno(), cMemo              // display contents
         endif
      enddo
      mclose( sTest->notes )              // close memo
      skip                                // next record
   enddo
   endproc

   proc main
   Test_mgetln()
   endproc

See Also: mputln()

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