Exemple #1
0
 private void compararTexto(string comparar, int indice)
 {
     if (comparar == "SI" || comparar == "SINO" || comparar == "SINO_SI" || comparar == "MIENTRAS" || comparar == "HACER" ||
         comparar == "DESDE" || comparar == "HASTA" || comparar == "INCREMENTO")
     {
         Area1.Select(indice, Area1.Text.Length);
         Area1.SelectionColor = Color.Green;
         Area1.SelectionStart = this.Area1.Text.Length;
     }
     else if (comparar == "verdadero" || comparar == "falso")
     {
         Area1.Select(indice, Area1.Text.Length);
         Area1.SelectionColor = Color.Orange;
         Area1.SelectionStart = this.Area1.Text.Length;
     }
     else if (comparar == "+" || comparar == "-" || comparar == "*" || comparar == "/" || comparar == "++" || comparar == "++" ||
              comparar == "--" || comparar == ">" || comparar == "<" || comparar == ">=" || comparar == "<=" || comparar == "==" ||
              comparar == "!=" || comparar == "||" || comparar == "&&" || comparar == "!" || comparar == "(" || comparar == ")")
     {
         Area1.Select(indice, Area1.Text.Length);
         Area1.SelectionColor = Color.DarkBlue;
         Area1.SelectionStart = this.Area1.Text.Length;
     }
     else if (comparar == "=" || comparar == ";")
     {
         Area1.Select(indice, Area1.Text.Length);
         Area1.SelectionColor = Color.Pink;
         Area1.SelectionStart = this.Area1.Text.Length;
     }
     else if (comparar == "A" || comparar == "B" || comparar == "i" || comparar == "a")
     {
         Area1.Select(indice, Area1.Text.Length);
         Area1.SelectionColor = Color.Brown;
         Area1.SelectionStart = this.Area1.Text.Length;
     }
     else
     {
         Area1.Select(indice, Area1.Text.Length);
         Area1.SelectionColor = Color.Black;
         Area1.SelectionStart = this.Area1.Text.Length;
     }
 }