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 - dynmemoclose() close a memo field http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 dynmemoclose()      Close a memo field
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func logical dynmemoclose 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 field.

 Return
   A logical indicating if the memo field could be successfully accessed.

 Description
   The dynmemoclose() function closes the file buffers associated with
   the memo uField.

   The function operates identically to the mclose() 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_dynmemoclose
   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_dynmemoclose()
   endproc

See Also: mclose()

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