I am working on c # but I need to verify if a void type meets a condition to follow instructions but I don't know how to do it, I was trying to do it with an if in the following way but it gives me error someone could help me, or tell me how I can check the condition :(
if ((lex.addtoken(analisis.Type.Words_Reserved_Planificador) == true)&&(lex.addtoken(analisis.Type.Symbol_Two_Points)==true)) { //Type is class Enum
instruccions
}
else
{
Console.WriteLIne("Error :(");
}
It would be great if the entire program was given. With the source code it would be easier.
You can use ' if ((lex.addToken(analysis.Type.Words_Reserved_Planificador))&&(lex.addtoken(analysis.Type.Symbol_Two_Points))) ' in order to check if there is any returned value of the function by deleting true as the return type.
If the return type is anything other than void then the ' if ' block instructions will be executed. If the return type is void then the ' else ' block will be executed.
For example,
if
((lex.addToken(analisis.Type.Words_Reserved_Planificador))&&(lex.addtoken(analysis.Type.Symbol_Two_Points)))
{
instructions
}
else
{
Console.WriteLine("Error :(");
}
Hope this helps.
Get Answers For Free
Most questions answered within 1 hours.