With LaTeX3 syntax the command is expandable, if needed:
\documentclass{article}
\usepackage{expl3}
\ExplSyntaxOn
\int_new:N \l_svend_condition_A_int
\int_new:N \l_svend_condition_B_int
\cs_new:Npn \svend_check:
{
\int_compare:nTF { \l_svend_condition_A_int = 100 }
{
\int_compare:nTF { \l_svend_condition_B_int = 100 }
{
\typeout{Both~are~100}
}
{
\typeout{A~is~100,~B~is~not~100}
}
}
{
\int_compare:nTF { \l_svend_condition_B_int = 100 }
{
\typeout{A~is~not~100,~B~is~100}
}
{
\typeout{A~is~not~100,~B~is~not~100}
}
}
}
\int_set:Nn \l_svend_condition_A_int {100}
\int_set:Nn \l_svend_condition_B_int {100}
\svend_check:
\int_set:Nn \l_svend_condition_A_int {100}
\int_set:Nn \l_svend_condition_B_int {101}
\svend_check:
\int_set:Nn \l_svend_condition_A_int {101}
\int_set:Nn \l_svend_condition_B_int {100}
\svend_check:
\int_set:Nn \l_svend_condition_A_int {101}
\int_set:Nn \l_svend_condition_B_int {101}
\svend_check:
Here's the output on the terminal:
Both are 100
A is 100, B is not 100
A is not 100, B is 100
A is not 100, B is not 100
With traditional syntax it's just the same:
\documentclass{article}
\newcommand{\Check}[2]{%
\ifnum#1=100
\ifnum#2=100
\typeout{\#1 is 100, \#2 is 100}%
\else
\typeout{\#1 is 100, \#2 is not 100}%
\fi
\else
\ifnum#2=100
\typeout{\#1 is not 100, \#2 is 100}%
\else
\typeout{\#1 is not 100, \#2 is not 100}%
\fi
\fi
}
\Check{100}{100}
\Check{101}{100}
\Check{100}{101}
\Check{101}{101}
Here's the output:
\#1 is 100, \#2 is 100
\#1 is not 100, \#2 is 100
\#1 is 100, \#2 is not 100
\#1 is not 100, \#2 is not 100
expl3syntax instead. – Sean Allred Feb 15 '14 at 20:44:)– Svend Tveskæg Feb 15 '14 at 20:46