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

 Syntax
   proc dynmemoedit extern
   param _ALIAS_PARAM  pAlias, ;
         value uint    uField, ;
         value uint    uTop, ;
         value uint    uLeft, ;
         value uint    uBottom, ;
         value uint    uRight, ;
         value logical lDisplayOnly

 Arguments
   pAlias is the alias for the database to access.

   uField is the ordinal number of the memo field.

   uTop is the top row of the display.

   uLeft is the leftmost column of the display.

   uBottom is the bottom row of the display.

   uRight is the rightmost of the display.

   lDisplayOnly specifies if the memo can only be viewed but not edited.

 Return
   None.

 Description
   The dynmemoedit() function displays and optionally edits a memo
   field.

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

See Also: medit()

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