PROCEDURE RegisterCustomLanguage LPARAMETERS loCodeMaxCtl LOCAL lang AS CodeMaxCtl.Language lang = CREATEOBJECT("CodemaxCtl.Language") lang.CaseSensitive = .T. LOCAL lcStr AS String lcstr = "for" + Chr$(10) + "friend" + Chr$(10) + "goto" lcstr = lcstr + Chr$(10) + "if" + Chr$(10) + "inline" + Chr$(10) + "int" lcstr = lcstr + Chr$(10) + "long" + Chr$(10) + "return" + Chr$(10) + "short" lcstr = lcstr + Chr$(10) + "signed" + Chr$(10) + "sizeof" lcstr = lcstr + Chr$(10) + "static" + "while" + Chr$(10) + "xalloc" lcstr = lcstr + Chr$(10) + "new" + Chr$(10) + "delete" lang.Keywords = lcstr lcstr = "::" + Chr$(10) + "." + Chr$(10) + "->" lcstr = lcstr + Chr$(10) + "++" + Chr$(10) + "--" + Chr$(10) + "*" lcstr = lcstr + Chr$(10) + "&" + Chr$(10) + "+" + Chr$(10) + "-" lcstr = lcstr + Chr$(10) + "!" + Chr$(10) + "~" + Chr$(10) + "sizeof" lang.Style = cmLangStyleProcedural lang.Operators = lcstr lang.SingleLineComments = "//" lang.MultiLineComments1 = "/*" lang.MultiLineComments2 = "*/" lang.ScopeKeywords1 = "{" lang.ScopeKeywords2 = "}" lang.StringDelims = Chr$(34) + Chr$(10) + "'" lang.EscapeChar = "\" lang.TerminatorChar = ";" LOCAL globals AS CodeMaxCtl.globals globals = CREATEOBJECT("CodeMaxCtl.globals") globals.RegisterLanguage("MyOwnC++",lang) **** Control.Language = "MyOwnC++" *** ?? Thisform.Control.Object.Language ????If your are using a minor version than VFP7, dont use AS. You will need to generate an .H file of your control(s) to get cmLangStyleProcedural constant. To get it use the Object Browser.
Private Sub RegisterCustomLanguage(ByVal Control As CodeMaxCtl.ICodeMax) Dim lang As CodeMaxCtl.Language Set lang = New CodeMaxCtl.Language lang.CaseSensitive = True Dim str As String str = "for" + Chr$(10) + "friend" + Chr$(10) + "goto" str = str + Chr$(10) + "if" + Chr$(10) + "inline" + Chr$(10) + "int" str = str + Chr$(10) + "long" + Chr$(10) + "return" + Chr$(10) + "short" str = str + Chr$(10) + "signed" + Chr$(10) + "sizeof" str = str + Chr$(10) + "static" + "while" + Chr$(10) + "xalloc" str = str + Chr$(10) + "new" + Chr$(10) + "delete" lang.Keywords = str str = "::" + Chr$(10) + "." + Chr$(10) + "->" str = str + Chr$(10) + "++" + Chr$(10) + "--" + Chr$(10) + "*" str = str + Chr$(10) + "&" + Chr$(10) + "+" + Chr$(10) + "-" str = str + Chr$(10) + "!" + Chr$(10) + "~" + Chr$(10) + "sizeof" lang.Style = cmLangStyleProcedural lang.Operators = str lang.SingleLineComments = "//" lang.MultiLineComments1 = "/*" lang.MultiLineComments2 = "*/" lang.ScopeKeywords1 = "{" lang.ScopeKeywords2 = "}" lang.StringDelims = Chr$(34) + Chr$(10) + "'" lang.EscapeChar = "\" lang.TerminatorChar = ";" Dim globals As CodeMaxCtl.globals Set globals = New CodeMaxCtl.globals Call globals.RegisterLanguage("MyOwnC++", lang) Control.Language = "MyOwnC++" End Sub