Hi Hariharan,
We usually use the following format for commenting the modifications:
// SharedProject name, Developer Name, Modification date - Begin
X++ code modifications
// SharedProject name, Developer Name, Modification date - End
Also, I modified the EditorScripts class and added a method inside this class to automate this process somehow. If anyone wants to add code comment, he just need to select the code, right click and select the option from the menu (Scripts -> Tagging -> CodeModifications) which opens a dialog asking for project name and then clicking OK button on that dialog will add the tagging as per your coding standards. Below is the code:
// This method will add the Start and end tags
public void tagging_CodeModifications(Editor editor)
{
#Define.NextLine('\n')
int currentLineNo = editor.selectionStartLine();
int currentCol = editor.selectionStartCol();
int selectedLine = editor.selectionEndLine();
Dialog dialog = new Dialog("Enter Project Name");
DialogField dlgExtTypeName = dialog.addField(extendedTypeStr(Name));
container dialogValue;
str tab = "";
tab = strRep("\t", currentCol/4);
dialogValue = xSysLastValue::getValue(curExt(), curUserId(), UtilElementType::ClassInstanceMethod, "SaveLastValue");
if (dialogValue != conNull())
{
dlgExtTypeName.value(conPeek(dialogValue, 1));
}
if (dialog.run())
{
dialogValue = conNull();
dialogValue += dlgExtTypeName.value();
xSysLastValue::putValue(dialogValue, curExt(), curUserId(), UtilElementType::ClassInstanceMethod, "SaveLastValue");
editor.gotoLine(currentLineNo - 1);
editor.gotoLine(currentLineNo);
editor.gotoCol(currentCol);
editor.insertLines(strFmt('// YourProjectPrefix_%1 %2 %3 Begin %4 %5', dlgExtTypeName.value(), strReplace(curUserId(),"I_",""), systemDateGet(), #NextLine, tab));
editor.gotoLine(selectedLine + 2);
editor.insertLines(strFmt('%1// YourProjectPrefix_%2 %3 %4 End %5', tab, dlgExtTypeName.value(), strReplace(curUserId(),"I_",""), systemDateGet(), #NextLine));
}
}
Please let me know if you have further queries.
Thanks,
Baber.