<-- Previous || Up || Next -->

Keep VB Comments Function
String Extras Class

Public Function KeepVBComments( _
      ByVal vLine As Variant _
    , Optional ByVal vKeepLeadingSpaces As Variant _
    ) As Variant

"Keep Visual Basic Comments"
Retain the comments within a string representing a line of Visual Basic code.
Returns a string containing the comment portion from a line of Visual Basic source code.

Examples:
    KeepVBComments("    ' Assignment.") = "' Assignment."
    KeepVBComments("    ' Assignment.", True) = "    ' Assignment."
    KeepVBComments("    lngNum = 45 ' Assignment.") = "' Assignment."
    KeepVBComments("    lngNum = 45 ' Assignment.", True) = "    ' Assignment."
    KeepVBComments("    lngNum = 45") = ""
See also:
    StripVBComments Function
    GetVBToken Function
vLine: The string containing a line of Visual Basic source code. Function returns Null if vLine is Null or cannot be fixed up to a String.

vKeepLeadingSpaces: Determine whether the spaces which precede any comments will be retained. True if leading spaces should be copied to the result string, and False if leading spaces should be ignored. vKeepLeadingSpaces defaults to False if it is missing or Null or cannot be fixed up to a number.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.