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 - dynmemoput() insert text into a memo http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 dynmemoput()        Insert text into a memo
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func logical dynmemoput extern
   param value _PALIAS pAlias, ;
         value uint    uField, ;
         const char    cText

 Arguments
   pAlias is the alias for the database to access.

   uField is the ordinal number of the memo field.

   cText is the string to write into the memo field.

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

 Description

   The dynmemoput() function inserts cText into uField.

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

See Also: dynmemoputln() mput()

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