We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

VBScript Comment/Uncomment


Using the predefined VBScript syntax, the Comment Selection command works, surrounding the code with an xml comment .

For my purposes, I've changed this to use the VBScript REM command, and the Editor works correctly on commenting again.

However, in neither case does the Uncomment command work. It simply does nothing (no exceptions are thrown, nothing is written to the debug window). Can you tell me why this doesn't work?

John

2 Replies

NR Nandakumar R Syncfusion Team August 21, 2009 04:48 AM UTC

Hi,

I regret for the inconvenience caused. Your DirectTrac incident has been updated with the details. There seem to be some issues with the lexem based changes when you try to make one. You can use the following workaround in the uncomment section and achieve this behaviour.

[C#]

private void Form1_Load(object sender, EventArgs e)
{
//Set start and end comment
this.editControl1.LoadFile(@"VBScriptSource.vbs");
this.editControl1.ApplyConfiguration(KnownLanguages.VBNET);

IConfigLanguage lan = this.editControl1.Language;
lan.StartComment = "REM ";
lan.EndComment = "";
}

private void btnComment_Click(object sender, EventArgs e)
{
//Comment
this.editControl1.CommentLine();
}

private void btnUncomment_Click(object sender, EventArgs e)
{
//Uncomment
this.editControl1.UnCommentLine();
string CommentedText = this.editControl1.SelectedText;
CommentedText = CommentedText.Replace(@"REM ", "");
editControl1.SelectedText = CommentedText.Replace(@"REM ", "");
editControl1.SelectionCancel();
}


Regards,
Nanda


NR Nandakumar R Syncfusion Team August 21, 2009 04:49 AM UTC


Loader.
Live Chat Icon For mobile
Up arrow icon