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 - dynmemoeof() determine if a memo is at eof http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 dynmemoeof()        Determine if a memo is at EOF
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func logical dynmemoeof extern
   param value _PALIAS pAlias, ;
         value uint    uField

 Arguments
   pAlias is the alias for the database to access.

   uField is the ordinal number of the memo field.

 Return
   A logical indicating if the memo is at end of file.

 Description
   The dynmemoeof() function returns .t. if the current memo read/write point
   is at the end of uField.

   The function operates identically to the meof() function, but
   supports dynamically opened databases.

 Example
   #define EXAMPLE_DATABASE
   #define _DYNALIAS_
   #define _ALIASPTR_
   #include example.hdr

   #define POS_MEMO 7  // memo field's position in test database
   
   proc Test_dynmemoeof
   vardef
      _PALIAS pDbf
      _SLIST  pList
   enddef
   pDbf := dynopen( 0, "stest.dbf", DO_SHARED )   // open database
   if pDbf                                        // if successful
      clear
   
      dynmemoopen( pDbf, POS_MEMO, MO_APPEND )    // open memo for appending
      dynmemoput( pDbf, POS_MEMO, "Hello world" ) // add a line
      @ 2, 2 ?? "Memo free space:", ;             // display free space
         istr( dynmemospace( pDbf, POS_MEMO ) ) + " characters"
      dynmemoclose( pDbf, POS_MEMO )              // close memo
   
      @ 3, 1 to 11, 79
      dynmemoedit( pDbf, POS_MEMO, 4, 2, 10, 78, .f. ) // edit memo field
   
      dynmemoopen( pDbf, POS_MEMO, MO_READ )      // open memo for reading
      pList := pickinit()                         // initialize a string list
      do while .not. dynmemoeof( pDbf, POS_MEMO ) // traverse memo
         pickadd( pList, dynmemoget( pDbf, POS_MEMO ) ) // fill list from memo
      enddo
      dynmemoclose( pDbf, POS_MEMO )              // close memo
      dynclose( pDbf )                            // close database
   
      @ 13, 1 to 21, 79
      pickdisp( pList, 14, 2, 20, 78 )            // display memo contents
   
      pickclear( pList )                          // clear the list
   endif
   endproc

   proc main
   Test_dynmemoeof()
   endproc

See Also: meof()

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