[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-------+##################################################################
#+-| M_PUT |-------------------------------------+############################
#| +-------+ Inserts text_string into memo_field |############################
#+-----------------------------------------------+############################
##############################################################################
##############################################################################
#+--| Summary |--------------+################################################
#| #INCLUDE memo.hdr |################################################
#+---------------------------+################################################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------------------------+##############
#| PROCEDURE m_put PROTOTYPE |##############
#| PARAMETERS MEMO memo_field, VALUE CHAR text_string |##############
#+-------------------------------------------------------------+##############
##############################################################################
##############################################################################
#########+---| Description |----------------------------------------+#########
#########| The m_put procedure inserts text_string into memo_field. |#########
#########| Carriage return and line-feed characters are NOT |#########
#########| prepended or appended to text_string. All characters |#########
#########| from text_string are placed into memo_field until a |#########
#########| NULL is encountered. |#########
#########| -------------------------------------------------------- |#########
#########| memo_field must have been opened in the &MO_WRITE or |#########
#########| &MO_APPEND mode. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+---| Design |---------------------------------------------+#########
#########| The m_put procedure allows more control over the output |#########
#########| string. Because carriage-return and line-feed |#########
#########| characters are not prepended or appended, m_put allows |#########
#########| for better string formatting, if required. Use m_put in |#########
#########| these cases: |#########
#########| |#########
#########| * Several lines are to be output to the memo |#########
#########| field as one single line, but it is NOT known |#########
#########| at runtime where the lines originate. |#########
#########| |#########
#########| * Some utilities require carriage-return |#########
#########| line-feed characters to be at the end of the |#########
#########| line, versus the beginning. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Write several character strings to a memo. After |#########
#########| * the strings have been output, write a |#########
#########| * carriage-return/line-feed sequence to |#########
#########| * terminate the line. |#########
#########| |#########
#########| m_put( a->m, "Request number:" ) |#########
#########| {...} |#########
#########| m_put( a->m, i_str( value ) ) && value = 1 |#########
#########| {...} |#########
#########| m_put( a->m, "okay. "+chr(13)+chr(10) ) |#########
#########| |#########
#########| *--- the above lines inserted this one line: |#########
#########| *--- Request number: 1 okay. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Output 1 line into a memo for every 3 |#########
#########| * lines read from a text file. |#########
#########| |#########
#########| DO WHILE .NOT. f_eof( f ) |#########
#########| count = 3 |#########
#########| REPEAT |#########
#########| f_getln( f, line_buffer ) |#########
#########| m_put( s->m, line_buffer ) |#########
#########| count = count - 1 |#########
#########| UNTIL count = 0 .OR. f_eof( f ) |#########
#########| ENDDO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
m_close
m_edit
m_eof()
m_exist()
m_getln
...
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson