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

 Syntax
   func char dynmemoget 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 line of text from the memo.

 Description
   The dynmemoget() function returns the current line from uField.

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

See Also: mgetln()

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