Adding Code Directly in Comments

You often want to insert source code samples in the resulting document. Therefore, VBdocman comes with predefined $CODE$ and $END-CODE$ macros, that are defined in all templates and provide formatting of source code.



'@rem Use this method for deciding whether the cell
' is empty:$EOL$
'    If getCell(1, 1) = 0 Then$EOL$
'        setCell 1, 1, 2$EOL$
'    End If
Public Function getCell(ByVal x As Integer, ByVal y As Integer) As Integer
End Function

You need to add $EOL$ macro at the end of each line (except the last one) so that there were line breaks in all output formats. Without it it wouldn't work in RTF and HLP because RTF syntax has no tag like HTML's <pre> and therefore needs to explicitly define new line. You don't need to do it manually, use automatic code insertion function from pop-up menu.

Note, $CODE$ and $END-CODE$ macros can be also applied to the title page text in the Options dialog.

For more information see Using Macros Directly in Comments.

Send feedback to Helixoft
© 2000-2005 Helixoft. All rights reserved.