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

 Syntax
   proc mopen extern
   param       memo mMemoField, ;
         value int  iMemoMode

 Arguments
   mMemoField is the memo to operate on.
   iMemoMode is the open mode.

 Return
   None.

 Description
   The mopen() procedure opens mMemoField for reading, writing or appending
   text.

   The iMemoMode parameter establishes access rights for mMemoField: read
   only, memo creation or appending. The memo is assumed to be in ASCII text
   with lines terminating in carriage return and line-feed characters.

   Values for the iMemoMode parameter are defined in memo.hdr as listed
   below:

   MO_READ      Open memo for reading only
   MO_CREATE    Create the memo, destroying any earlier contents
   MO_APPEND    Open memo for appending text, preserving earlier contents

   The mopen() procedure uses a DOS file handle. The mclose() function closes
   the memo and returns the handle to DOS.

   The Force library supports up to 255 open files at one time. Use
   morehandles() to allocate more DOS file handles.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   proc Test_mopen
   open sTest                          // open database
   go 33
   ? sTest->lastname
   ShowMemo( sTest->notes )
   mopen( sTest->notes, MO_APPEND )    // open memo field for current record
   mput( sTest->notes, "appended text" )  // append a line
   mclose( sTest->notes )              // close memo
   ShowMemo( sTest->notes )
   mopen( sTest->notes, MO_CREATE )    // open memo field for current record
   mput( sTest->notes, "new text" )    // replace line
   mclose( sTest->notes )              // close memo
   ShowMemo( sTest->notes )
   endproc

   proc main
   Test_mopen()
   endproc

See Also: mclose()

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