| 1 |
<html> |
| 2 |
<head> |
| 3 |
<title>IF Metacommand in Embperl</title> |
| 4 |
</head> |
| 5 |
|
| 6 |
<body> |
| 7 |
|
| 8 |
[- $a = 1; $b = 0; $c = 5; $d = 'txt' -] |
| 9 |
|
| 10 |
a1 |
| 11 |
[$if $a$] |
| 12 |
a <br> |
| 13 |
[$ endif$] |
| 14 |
|
| 15 |
a2 |
| 16 |
[$if $a $] |
| 17 |
a <br> |
| 18 |
[$else$] |
| 19 |
not a<br> |
| 20 |
[$ endif $] |
| 21 |
|
| 22 |
a3 |
| 23 |
[$if $a<br> $] |
| 24 |
a <br> |
| 25 |
[$else<br>$] |
| 26 |
not a<br> |
| 27 |
[$ endif <br>$] |
| 28 |
|
| 29 |
a4 |
| 30 |
[# |
| 31 |
[$<br>if $a $] |
| 32 |
a <br> |
| 33 |
[$ <br> else<br>$] |
| 34 |
not a<br> |
| 35 |
[$ <br>endif $] |
| 36 |
#] |
| 37 |
a5 |
| 38 |
[$ if $a$] |
| 39 |
a <br> |
| 40 |
[$if $b == 0$] |
| 41 |
b is null <br> |
| 42 |
[$else$] |
| 43 |
b is not null <br> |
| 44 |
[$endif$] |
| 45 |
[$ else$] |
| 46 |
not a<br> |
| 47 |
[$ endif $] |
| 48 |
|
| 49 |
|
| 50 |
[$ if $a$] |
| 51 |
a <br> |
| 52 |
[$if $b == 0$] |
| 53 |
b is null <br> |
| 54 |
[$else$] |
| 55 |
b is not null <br> |
| 56 |
[$endif$] |
| 57 |
[$ else$] |
| 58 |
not a<br> |
| 59 |
[$if $b == 0$] |
| 60 |
b is null <br> |
| 61 |
[$else$] |
| 62 |
b is not null <br> |
| 63 |
[$endif$] |
| 64 |
[$ endif $] |
| 65 |
|
| 66 |
|
| 67 |
[$ if !$a$] |
| 68 |
not a <br> |
| 69 |
[$if $b == 0$] |
| 70 |
b is null <br> |
| 71 |
[$else$] |
| 72 |
b is not null <br> |
| 73 |
[$endif$] |
| 74 |
[$ else$] |
| 75 |
a<br> |
| 76 |
[$if $b == 0$] |
| 77 |
b is null <br> |
| 78 |
[$else$] |
| 79 |
b is not null <br> |
| 80 |
[$endif$] |
| 81 |
[$ endif $] |
| 82 |
|
| 83 |
|
| 84 |
[$ if $a$] |
| 85 |
a <br> |
| 86 |
[$if $b == 0$] |
| 87 |
b is null <br> |
| 88 |
[$elsif $c == 5 $] |
| 89 |
b is not null and c is 5 <br> |
| 90 |
[$elsif $d eq 'txt'$] |
| 91 |
b is not null and c is not 5, but d is 'txt' <br> |
| 92 |
[$else$] |
| 93 |
b is not null and c is not 5 and d is not 'txt' <br> |
| 94 |
[$endif$] |
| 95 |
[$ else$] |
| 96 |
not a<br> |
| 97 |
[$ endif $] |
| 98 |
|
| 99 |
|
| 100 |
[$ if $a$] |
| 101 |
a <br> |
| 102 |
[$if $b == 0$] |
| 103 |
b is null <br> |
| 104 |
[$elsif $c == 5 $] |
| 105 |
b is not null and c is 5 <br> |
| 106 |
[$elsif $d eq 'txt'$] |
| 107 |
b is not null and c is not 5, but d is 'txt' <br> |
| 108 |
[$else$] |
| 109 |
b is not null and c is not 5 and d is not 'txt' <br> |
| 110 |
[$endif$] |
| 111 |
[$ else$] |
| 112 |
not a<br> |
| 113 |
[$if $b == 0$] |
| 114 |
b is null <br> |
| 115 |
[$elsif $c == 5 $] |
| 116 |
b is not null and c is 5 <br> |
| 117 |
[$elsif $d eq 'txt'$] |
| 118 |
b is not null and c is not 5, but d is 'txt' <br> |
| 119 |
[$else$] |
| 120 |
b is not null and c is not 5 and d is not 'txt' <br> |
| 121 |
[$endif$] |
| 122 |
[$ endif $] |
| 123 |
|
| 124 |
|
| 125 |
[$ if $a == 0 $] |
| 126 |
a is null <br> |
| 127 |
[$if $b != 0$] |
| 128 |
b not is null <br> |
| 129 |
[$elsif $c == 5 $] |
| 130 |
b is null and c is 5 <br> |
| 131 |
[$elsif $d eq 'txt'$] |
| 132 |
b is null and c is not 5, but d is 'txt' <br> |
| 133 |
[$else$] |
| 134 |
b is null and c is not 5 and d is not 'txt' <br> |
| 135 |
[$endif$] |
| 136 |
[$ else$] |
| 137 |
a is not null <br> |
| 138 |
[$if $b != 0$] |
| 139 |
b is not null <br> |
| 140 |
[$elsif $c == 5 $] |
| 141 |
b is null and c is 5 <br> |
| 142 |
[$elsif $d eq 'txt'$] |
| 143 |
b is null and c is not 5, but d is 'txt' <br> |
| 144 |
[$else$] |
| 145 |
b is null and c is not 5 and d is not 'txt' <br> |
| 146 |
[$endif$] |
| 147 |
[$ endif $] |
| 148 |
|
| 149 |
|
| 150 |
[$ if $a == 0 $] |
| 151 |
a is null <br> |
| 152 |
[$if $b != 0$] |
| 153 |
b not is null <br> |
| 154 |
[$elsif $c == 5 $] |
| 155 |
b is null and c is 5 <br> |
| 156 |
[$elsif $d eq 'txt'$] |
| 157 |
b is null and c is not 5, but d is 'txt' <br> |
| 158 |
[$else$] |
| 159 |
b is null and c is not 5 and d is not 'txt' <br> |
| 160 |
[$endif$] |
| 161 |
[$ else$] |
| 162 |
a is not null <br> |
| 163 |
[$if $b != 0$] |
| 164 |
b is not null <br> |
| 165 |
[$elsif $c != 5 $] |
| 166 |
b is null and c is not 5 <br> |
| 167 |
[$elsif $d ne 'txt'$] |
| 168 |
b is null and c is not 5, but d is not 'txt' <br> |
| 169 |
[$else$] |
| 170 |
b is null and c is 5 and d is 'txt' <br> |
| 171 |
[$endif$] |
| 172 |
[$ endif $] |
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
[$ if $a == 0 $] |
| 177 |
a is null <br> |
| 178 |
[$if $b != 0$] |
| 179 |
b not is null <br> |
| 180 |
[$elsif $c == 5 $] |
| 181 |
b is null and c is 5 <br> |
| 182 |
[$elsif $d eq 'txt'$] |
| 183 |
b is null and c is not 5, but d is 'txt' <br> |
| 184 |
[$else$] |
| 185 |
b is null and c is not 5 and d is not 'txt' <br> |
| 186 |
[$endif$] |
| 187 |
[$ else$] |
| 188 |
a is not null <br> |
| 189 |
[$if $b != 0$] |
| 190 |
b is not null <br> |
| 191 |
[$elsif $c != 5 $] |
| 192 |
b is null and c is not 5 <br> |
| 193 |
[$elsif $d ne 'txt'$] |
| 194 |
b is null and c is not 5, but d is not 'txt' <br> |
| 195 |
[$else$] |
| 196 |
b is null and c is 5 and d is 'txt' <br> |
| 197 |
[$if $b != 0$] |
| 198 |
b is not null <br> |
| 199 |
[$elsif $c != 5 $] |
| 200 |
b is null and c is not 5 <br> |
| 201 |
[$elsif $d eq 'txt'$] |
| 202 |
b is null and c is not 5, but d is 'txt' <br> |
| 203 |
[$if $d eq 'txt'$] |
| 204 |
If we get to here it looks good with the tests <br> |
| 205 |
[$else$] |
| 206 |
No not go to here, something is wrong! <br> |
| 207 |
[$endif$] |
| 208 |
|
| 209 |
[$else$] |
| 210 |
b is null and c is 5 and d is 'txt' <br> |
| 211 |
[$endif$] |
| 212 |
[$endif$] |
| 213 |
[$ endif $] |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
[$ if $a == 0 $] |
| 219 |
a is null <br> |
| 220 |
[$if $b != 0$] |
| 221 |
b not is null <br> |
| 222 |
[$elsif $c == 5 $] |
| 223 |
b is null and c is 5 <br> |
| 224 |
[$elsif $d eq 'txt'$] |
| 225 |
b is null and c is not 5, but d is 'txt' <br> |
| 226 |
[$else$] |
| 227 |
b is null and c is not 5 and d is not 'txt' <br> |
| 228 |
[$endif$] |
| 229 |
[$ else$] |
| 230 |
a is not null <br> |
| 231 |
[$if $b != 0$] |
| 232 |
b is not null <br> |
| 233 |
[$if $d eq 'txt'$] |
| 234 |
No not go to here, something is wrong! (a) <br> |
| 235 |
[$else$] |
| 236 |
No not go to here, something is wrong! (b) <br> |
| 237 |
[$endif$] |
| 238 |
[$elsif $c != 5 $] |
| 239 |
b is null and c is not 5 <br> |
| 240 |
[$if $d eq 'txt'$] |
| 241 |
No not go to here, something is wrong! (a) <br> |
| 242 |
[$else$] |
| 243 |
No not go to here, something is wrong! (b) <br> |
| 244 |
[$endif$] |
| 245 |
[$elsif $d ne 'txt'$] |
| 246 |
b is null and c is not 5, but d is not 'txt' <br> |
| 247 |
[$if $d eq 'txt'$] |
| 248 |
No not go to here, something is wrong! (a) <br> |
| 249 |
[$else$] |
| 250 |
No not go to here, something is wrong! (b) <br> |
| 251 |
[$endif$] |
| 252 |
[$else$] |
| 253 |
b is null and c is 5 and d is 'txt' <br> |
| 254 |
[$if $b != 0$] |
| 255 |
b is not null <br> |
| 256 |
[$if $d eq 'txt'$] |
| 257 |
No not go to here, something is wrong! (a) <br> |
| 258 |
[$else$] |
| 259 |
No not go to here, something is wrong! (b) <br> |
| 260 |
[$endif$] |
| 261 |
[$elsif $c != 5 $] |
| 262 |
b is null and c is not 5 <br> |
| 263 |
[$if $d eq 'txt'$] |
| 264 |
No not go to here, something is wrong! (a) <br> |
| 265 |
[$else$] |
| 266 |
No not go to here, something is wrong! (b) <br> |
| 267 |
[$endif$] |
| 268 |
[$elsif $d eq 'txt'$] |
| 269 |
b is null and c is not 5, but d is 'txt' <br> |
| 270 |
[$if $d eq 'txt'$] |
| 271 |
If we get to here it looks good with the tests <br> |
| 272 |
[$else$] |
| 273 |
No not go to here, something is wrong! <br> |
| 274 |
[$endif$] |
| 275 |
|
| 276 |
[$else$] |
| 277 |
b is null and c is 5 and d is 'txt' <br> |
| 278 |
[$if $d eq 'txt'$] |
| 279 |
No not go to here, something is wrong! (a) <br> |
| 280 |
[$else$] |
| 281 |
No not go to here, something is wrong! (b) <br> |
| 282 |
[$endif$] |
| 283 |
[$endif$] |
| 284 |
[$endif$] |
| 285 |
[$ endif $] |
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
[- $ttrue = 'true'; $tfalse = '' -] |
| 290 |
|
| 291 |
[$if $ttrue $] |
| 292 |
ttrue = true |
| 293 |
[$else$] |
| 294 |
ttrue = false |
| 295 |
[$endif$] |
| 296 |
|
| 297 |
[$if $tfalse $] |
| 298 |
tfalse = true |
| 299 |
[$else$] |
| 300 |
tfalse = false |
| 301 |
[$endif$] |
| 302 |
|
| 303 |
The following HTML tags schould be ignored by Embperl |
| 304 |
|
| 305 |
<if 0> |
| 306 |
|
| 307 |
Ignored, ok! |
| 308 |
|
| 309 |
<else> |
| 310 |
|
| 311 |
Not ignored, ERROR! |
| 312 |
|
| 313 |
<endif> |
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
<TABLE WIDTH="530" BORDER="0"> |
| 318 |
<TR> |
| 319 |
<TD ALIGN="LEFT"> |
| 320 |
[$ if ($badge eq "iit") $] |
| 321 |
<A HREF="/iit/"> |
| 322 |
[$ else $] |
| 323 |
<A HREF="/"> |
| 324 |
[$ endif $] |
| 325 |
<IMG SRC="[$ if (($server_type eq "iii.co.uk")) $]/i/www.[+ $server_type +]/[+ $badge || "iiilogo_narrow" +].gif[$ else $]/icons/[+ $badge || "iiilogo_narrow" +].gif[$ endif $]" |
| 326 |
WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 327 |
[$ if ($badge eq "iit") $] |
| 328 |
ALT="iit logo" |
| 329 |
[$ else $] |
| 330 |
ALT="iii logo" |
| 331 |
[$ endif $] |
| 332 |
[$ if (($badge eq "iit") && ($badge ne $cookie_badge) && !$cookie_to) $] |
| 333 |
onload="window.open('/iit/welcometoiit.epl','dis','status=no,scrollbars=no,resizable=yes,width=390,height=410,screenX=50,screenY=50,top=50,left=50'); return false" |
| 334 |
[$ elsif (($badge eq "") && ($cookie_badge eq "iit") && !$cookie_from) $] |
| 335 |
onload="window.open('/iit/leavingiit.epl','dis','status=no,scrollbars=no,resizable=yes,width=370,height=320,screenX=100,screenY=100,top=100,left=100'); return false" |
| 336 |
[$ endif $] qqq > |
| 337 |
|
| 338 |
</TD> |
| 339 |
</TR> |
| 340 |
</TABLE> |
| 341 |
|
| 342 |
[- $cookie_badge = "iit" ; |
| 343 |
$server_type = "iii.co.uk" ; |
| 344 |
$icon_width = 1 ; |
| 345 |
$icon_height=2; -] |
| 346 |
<TABLE WIDTH="530" BORDER="0"> |
| 347 |
<TR> |
| 348 |
<TD ALIGN="LEFT"> |
| 349 |
[$ if ($badge eq "iit") $] |
| 350 |
<A HREF="/iit/"> |
| 351 |
[$ else $] |
| 352 |
<A HREF="/"> |
| 353 |
[$ endif $] |
| 354 |
<IMG SRC="[$ if (($server_type eq "iii.co.uk")) $]/i/www.[+ $server_type +]/[+ $badge || "iiilogo_narrow" +].gif[$ else $]/icons/[+ $badge || "iiilogo_narrow" +].gif[$ endif $]" |
| 355 |
WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 356 |
[$ if ($badge eq "iit") $] |
| 357 |
ALT="iit logo" |
| 358 |
[$ else $] |
| 359 |
ALT="iii logo" |
| 360 |
[$ endif $] |
| 361 |
[$ if (($badge eq "iit") && ($badge ne $cookie_badge) && !$cookie_to) $] |
| 362 |
onload="window.open('/iit/welcometoiit.epl','dis','status=no,scrollbars=no,resizable=yes,width=390,height=410,screenX=50,screenY=50,top=50,left=50'); return false" |
| 363 |
[$ elsif (($badge eq "") && ($cookie_badge eq "iit") && !$cookie_from) $] |
| 364 |
onload="window.open('/iit/leavingiit.epl','dis','status=no,scrollbars=no,resizable=yes,width=370,height=320,screenX=100,screenY=100,top=100,left=100'); return false" |
| 365 |
[$ endif $]> |
| 366 |
|
| 367 |
</TD> |
| 368 |
</TR> |
| 369 |
</TABLE> |
| 370 |
|
| 371 |
|
| 372 |
[- $icon_width = 5 ; $icon_height=10; -] |
| 373 |
|
| 374 |
<IMG |
| 375 |
[$ if (($server_type eq "iii")) $] |
| 376 |
SRC="/i/www.[+ $server_type +]/[+ $badge || "iiilogo_narrow_if" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 377 |
[$ else $] |
| 378 |
SRC="/icons/[+ $badge || "iiilogo_narrow_else" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 379 |
[$ endif $] |
| 380 |
[$ if ($badge eq "iit") $] |
| 381 |
ALT="iit logo" |
| 382 |
[$ else $] |
| 383 |
ALT="iii logo" |
| 384 |
[$ endif $]> |
| 385 |
|
| 386 |
[- $icon_width = 6 ; $icon_height=11; $server_type="iii" ; $badge = "iit" -] |
| 387 |
|
| 388 |
<IMG |
| 389 |
[$ if (($server_type eq "iii")) $] |
| 390 |
SRC="/i/www.[+ $server_type +]/[+ $badge || "iiilogo_narrow_if" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 391 |
[$ else $] |
| 392 |
SRC="/icons/[+ $badge || "iiilogo_narrow_else" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 393 |
[$ endif $] |
| 394 |
[$ if ($badge eq "iit") $] |
| 395 |
ALT="iit logo" |
| 396 |
[$ else $] |
| 397 |
ALT="iii logo" |
| 398 |
[$ endif $]> |
| 399 |
|
| 400 |
<IMG |
| 401 |
[$ if (($server_type eq "iii")) $] |
| 402 |
SRC="/i/www.[+ $server_type +]/[+ $badge || "iiilogo_narrow_if" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 403 |
[$ else $] |
| 404 |
SRC="/icons/[+ $badge || "iiilogo_narrow_else" +].gif" WIDTH="[+ $icon_width +]" HEIGHT="[+ $icon_height +]" BORDER="0" |
| 405 |
[$ endif $] |
| 406 |
[$ if ($badge eq "iit") $] |
| 407 |
ALT="iit logo" |
| 408 |
[$ else $] |
| 409 |
ALT="iii logo" |
| 410 |
[$ endif $] |
| 411 |
qqq> |
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
</body> |
| 416 |
</html> |
| 417 |
|