-
1. MRL if...elseif statement
Frank ThomaeMay 3, 2012 3:01 PM (in response to Philip Albert)
1 of 1 people found this helpfulHi Philip,
try this one:
if ($EV.mc_host contains 'domain1') then
{
$FLDS = strtolist($EV.mc_host, '.');
$EV.IA_host = listgetelt($FLDS, 1);
}
else
{
if ($EV.mc_host contains 'domain2') then
{
$FLDS = strtolist($EV.mc_host, '.');
$EV.IA_host = listgetelt($FLDS, 1);
}
else
{
if ($EV.mc_host contains 'domain3') then
{
$FLDS = strtolist($EV.mc_host, '.');
$EV.IA_host = listgetelt($FLDS, 1);
}
else
{
$EV.IA_host =$EV.mc_host;
};
};
};
I didn't have a chance to compile it, but it should work.
HTH,
Frank
-
2. MRL if...elseif statement
Oleg Protokolov May 4, 2012 2:34 AM (in response to Philip Albert)Philip, Hi!
In MRL there is no statement like IF-THEN-ELSEIF-ELSE
There is only IF-THEN-ELSE
Very sad about this ...
In your case, use this compact MRL-code:
if ( $EV.mc_host contains 'domain1'
OR $EV.mc_host contains 'domain2'
OR $EV.mc_host contains 'domain3'
) then
{
$FLDS = strtolist( $EV.mc_host, '.' );
$EV.IA_host = listgetelt( $FLDS, 1 );
}
else
{
$EV.IA_host =$EV.mc_host;
};
--
Regards,
Oleg
-
3. MRL if...elseif statement
Philip Albert May 4, 2012 7:42 AM (in response to Oleg Protokolov)Thanks Oleg, that's going to work.
Thanks Frank for your suggestion. I'll use Oleg's code, it's shorter.