File: user-guide_fi.html

package info (click to toggle)
velocity 1.4-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 17,900 kB
  • ctags: 9,916
  • sloc: java: 24,335; xml: 17,188; sh: 99; lisp: 53; makefile: 16
file content (4183 lines) | stat: -rw-r--r-- 219,543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!--
Copyright 1999-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->


<!-- Content Stylesheet for Site -->

        
<!-- start the processing -->
    <!-- ====================================================================== -->
    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
    <!-- Main Page Section -->
    <!-- ====================================================================== -->
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

                                                    <meta name="author" value="Velocity Documentation Team">
            <meta name="email" value="jvanzyl@zenplex.com">
                                        <meta name="author" value="John Castura">
            <meta name="email" value="jcastura@kw.igs.net">
                                        <meta name="author" value="Juha Kilpi">
            <meta name="email" value="juha@dwebs.com">
            
           
                                    
                        
            <title>Velocity - Velocity kyttjn opas</title>
        </head>

        <body bgcolor="#ffffff" text="#000000" link="#525D76">        
            <table border="0" width="100%" cellspacing="0">
                <!-- TOP IMAGE -->
                <tr>
                    <td align="left">
<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
</td>
<td align="right">
<a href="http://jakarta.apache.org/velocity/"><img src="./images/logo.gif" alt="Velocity" border="0"/></a>
</td>
                </tr>
            </table>
            <table border="0" width="100%" cellspacing="4">
                <tr><td colspan="2">
                    <hr noshade="" size="1"/>
                </td></tr>
                
                <tr>
                    <!-- LEFT SIDE NAVIGATION -->
                    <td width="20%" valign="top" nowrap="true">
                    
    <!-- ============================================================ -->

                <p><strong>About</strong></p>
        <ul>
                    <li>    <a href="./index.html">Overview</a>
</li>
                    <li>    <a href="./getting-started.html">Getting Started</a>
</li>
                    <li>    <a href="http://jakarta.apache.org/builds/jakarta-velocity/">Download</a>
</li>
                    <li>    <a href="./install.html">Install</a>
</li>
                    <li>    <a href="./design.html">Design</a>
</li>
                    <li>    <a href="./contributors.html">Contributors</a>
</li>
                    <li>    <a href="./changes.html">ChangeLog</a>
</li>
                    <li>    <a href="./code-standards.html">Coding Standards</a>
</li>
                    <li>    <a href="./license.html">License</a>
</li>
                    <li>    <a href="./todo.html">TODO</a>
</li>
                    <li>    <a href="http://issues.apache.org/bugzilla/enter_bug.cgi?product=Velocity">Report Issues</a>
</li>
                </ul>
            <p><strong>Community</strong></p>
        <ul>
                    <li>    <a href="./powered.html">Powered By Velocity</a>
</li>
                    <li>    <a href="http://jakarta.apache.org/site/getinvolved.html">Get Involved</a>
</li>
                    <li>    <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
</li>
                    <li>    <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
</li>
                </ul>
            <p><strong>Docs</strong></p>
        <ul>
                    <li>    <a href="./user-guide.html">User's Guide (English)</a>
</li>
                    <li>    <a href="./user-guide_fi.html">User's Guide (Finnish)</a>
</li>
                    <li>    <a href="./user-guide_fr.html">User's Guide (French)</a>
</li>
                    <li>    <a href="./user-guide_es.html">User's Guide (Spanish)</a>
</li>
                    <li>    <a href="./developer-guide.html">Developer's Guide</a>
</li>
                    <li>    <a href="./vtl-reference-guide.html">VTL Reference Guide</a>
</li>
                    <li>    <a href="./specification.html">Specification</a>
</li>
                    <li>    <a href="./api/index.html">Javadoc</a>
</li>
                </ul>
            <p><strong>Tools</strong></p>
        <ul>
                    <li>    <a href="./tools/index.html">Velocity Tools</a>
</li>
                    <li>    <a href="./anakia.html">Anakia : XML->doc tool</a>
</li>
                    <li>    <a href="./texen.html">Texen : text generation</a>
</li>
                    <li>    <a href="./dvsl/index.html">DVSL : XML xformation</a>
</li>
                    <li>    <a href="./veltag.html">Veltag : JSP taglib</a>
</li>
                    <li>    <a href="./migration.html">Migration to Velocity</a>
</li>
                    <li>    <a href="./devtools.html">Editors and IDEs</a>
</li>
                </ul>
            <p><strong>Comparisons</strong></p>
        <ul>
                    <li>    <a href="./ymtd/ymtd.html">YMTD</a>
</li>
                    <li>    <a href="./differences.html">VM/WM Differences</a>
</li>
                    <li>    <a href="./casestudy1.html">JSP vs. Velocity</a>
</li>
                    <li>    <a href="./casestudy2.html">XMLC vs. Velocity</a>
</li>
                </ul>
            <p><strong>Site Translations</strong></p>
        <ul>
                    <li>    <a href="http://jakarta.apache.org/velocity/">English</a>
</li>
                    <li>    <a href="http://www.ingrid.org/jajakarta/velocity/velocity-1.2-rc2/docs-ja/index.html">Japanese</a>
</li>
                </ul>
                        </td>
                    <td width="80%" align="left" valign="top">
                                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Sisllys"><strong>Sisllys</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <ol>
<li><a href="#Tietoja tst oppaasta">Tietoja tst oppaasta</a></li>
<li><a href="#Mik on Velocity?">Mik on Velocity?</a></li>
<li><a href="#Miten voin kytt Velocity?">Miten voin kytt Velocity?</a>
    <ol>
        <li><a href="#Kurakauppa esimerkki">Kurakauppa esimerkki</a></li>
    </ol>
</li>
<li><a href="#Velocity Template Language (VTL): Johdanto">Velocity
Template Language (VTL): Johdanto</a></li> 
<li><a href="#Hei Velocity Maailma!">Hei Velocity Maailma!</a></li>
<li><a href="#Kommentit">Kommentit</a></li>
<li><a href="#Viittaukset">Viittaukset</a>
    <ol>
        <li><a href="#Muuttujat">Muuttujat</a></li>
        <li><a href="#Ominaisuudet">Ominaisuudet</a></li>
        <li><a href="#Metodit">Metodit</a></li>
    </ol>
</li>
<li><a href="#Muodollinen merkint">Muodollinen viittausten merkint</a></li>
<li><a href="#Hiljainen viittausten merkint">Hiljainen viittausten merkint</a></li>
<li><a href="#Kirjaimellisesti">Kirjaimellisesti</a>
    <ol>
        <li><a href="#Dollari">Dollari</a></li>
        <li><a href="#VTL viittausten suojaaminen">VTL viittausten suojaaminen</a></li>
    </ol>
</li>
<li><a href="#Kirjainkoon muutos">Kirjainkoon muutos</a></li>
<li><a href="#Ohjeet">Ohjeet</a>
    <ol>
        <li><a href="#Set">Set</a></li>
        <li><a href="#Tekstivakiot">Tekstivakiot</a></li>
        <li><a href="#If-Else ehtolauseet">If-Else ehtolauseet</a>
            <ol>
                <li><a href="#Relaatio- ja loogiset operaattorit">Relaatio- ja loogiset
                operaattorit</a></li>
            </ol>
        </li>
        <li><a href="#Silmukat">Foreach silmukat</a></li>
        <li><a href="#Include">Include</a></li>
        <li><a href="#Parse">Parse</a></li>
        <li><a href="#Stop">Stop</a></li>
        <li><a href="#Velocimakrot">Velocimakrot</a></li>
    </ol>
</li>
<li><a href="#VTL ohjeiden suojaaminen">VTL ohjeiden suojaaminen</a></li>
<li><a href="#VTL: Muotoilu">VTL: Muotoilu</a></li>
<li><a href="#Muita ominaisuuksia ja sekalaista">Muita ominaisuuksia ja sekalaista</a>
    <ol>
        <li><a href="#Matematiikka">Matematiikka</a></li>
        <li><a href="#Vaihteluvli (Range Operator)">Vaihteluvli (Range Operator)</a></li>
        <li><a href="#Edistyneet kysymykset: Suojaaminen ja         !">Edistyneet kysymykset: Suojaaminen ja !</a></li>
        <li><a href="#Yleist Velocimakroista">Yleist Velocimakroista</a></li>
        <li><a href="#Merkkijonojen yhdistminen">Merkkijonojen yhdistminen</a></li>
    </ol>
</li>
<li><a href="#Palaute">Palaute</a></li>
</ol>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Tietoja tst oppaasta"><strong>Tietoja tst oppaasta</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Velocity kyttjn opas on tarkoitettu sivusuunnittelijoille ja
    sisllntuottajille avuksi tutustuttaessa Velocityyn ja sen
    yksinkertaiseen mutta tehokkaaseen skriptikieleen, Velocity
    Template Language:en (VTL). Useat tmn oppaan esimerkeist
    ksittelevt Velocityn kyttmist dynaamisen sislln
    lismiseksi web sivuille, mutta kaikki VTL esimerkit toimivat
    HTML sivujen lisksi yht hyvin mys muiden sivujen ja sivupohjien
    kanssa.
 </p>
                                                <p>
    Kiitos ett valitsit Velocityn!
 </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Mik on Velocity?"><strong>Mik on Velocity?</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Velocity on javapohjainen sivumoottori (template engine). Sen
    avulla sivusuunnittelijat voivat viitata java -koodissa
    mriteltyihin metodeihin. Sivusuunnittelijat voivat tyskennell
    java ohjelmoijien kanssa samanaikaisesti kytten
    Malli-Nkym-Ohjain (Model-View-Controller, MVC)
    suunnittelumallia. MVC mallissa sivusuunnittelijat voivat
    keskitty tysin luomaan hyvin suunniteltua sivustoa, ja
    ohjelmoijat voivat keskitty koodaamaan ykksluokan
    koodia. Velocity erottaa java -koodin web sivuista, tehden
    sivustosta pitkll aikavlill helpommin yllpidettvn ja
    antamalla varteenotettavan vaihtoehdon <a href="http://java.sun.com/products/jsp/">JSP</a>:lle (Java Server
    Pages) ja <a href="http://www.php.net/">PHP</a>:lle.
 </p>
                                                <p>
    Velocity voidaan kytt web sivujen, SQL:n, PostScriptin ja
    muunlaisten tulosteiden tuottamiseen sivupohjista (template). Sit
    voidaan kytt joko itsenisen tykaluna lhdekoodin ja
    raporttien luomiseen, tai muihin jrjestelmiin integroituna
    komponenttina. Velocity tarjoaa sivupohjaratkaisun <a href="http://java.apache.org/turbine/">Turbine</a> web
    sovelluskehykselle. Yhdess Velocity ja Turbine tarjoavat
    sivupohjaratkaisun jonka avulla web sovelluksia voidaan kehitt
    todellisen MVC -mallin mukaisesti.
 </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Miten voin kytt Velocity?"><strong>Miten voin kytt Velocity?</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                        <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Kurakauppa esimerkki"><strong>Kurakauppa esimerkki</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Oletetaan ett olet kuraa myyvn onlinekaupan
    sivusuunnittelija. Kutsumme kauppaa "Kurakauppa
    Online":ksi. Kauppa ky hyvin. Asiakkaat tilaavat vaihtelevia
    mri eri kuratyyppej. He psevt tutkimaan tekemin tilauksia
    sek tekemn uusia ostoja kirjautumalla sivullesi kytten
    kyttjtunnustaan ja salasanaansa. Tll hetkell suosittu
    Terracotta -kura on alennusmyynniss. Pieni osa asiakkaistasi
    ostaa snnllisesti Kirkkaanpunaista Kuraa, joka mys on
    alennusmyynniss, mutta pienemmn suosionsa vuoksi yleens
    mainittu sivulla hieman syrjss. Tiedot kustakin asiakkaasta
    talletetaan tietokantaan, joten ern pivn her kysymys;
    Miksip emme kyttisi Velocity kohdentamaan erikoistarjouksia
    kurasta asiakkaille jotka ovat kiinnostuneita juuri tuosta
    kuratyypist?
   </p>
                                                <p>
    Velocityn avulla verkkosivut on helppo personoida kvijidesi
    mukaan. Kurakauppa Onlinen sivusuunnittelijana haluat tehd sivun
    jonka asiakas nkee kirjauduttuaan jrjestelmn.
   </p>
                                                <p>
    Tapaat yrityksesi ohjelmoijat ja sovitte, ett muuttuja
    <em>$asiakas</em> pit sislln tiedot parhaillaan kirjautuneena
    olevasta asiakkaasta. Muuttujassa <em>$kuratTarjouksessa</em> ovat
    tiedot kuratyypeist jotka ovat parhaillaan
    erikoistarjouksessa. <em>$tarjous</em> objektissa on metodeja
    jotka auttavat mainostamisessa. Tll kertaa keskitymme vain
    nihin kolmeen viittaukseen. Muista, ett sinun ei tarvitse
    huolehtia siit kuinka ohjelmoijat hakevat tarvittavat tiedot
    tietokannasta, sinun tarvitsee tiet vain ett se toimii. Nin
    pset tekemn omaa tytsi ja ohjelmoijat psevt tekemn
    omaansa.
   </p>
                                                <p>
    Voisit list seuraavat VTL lauseen sivulle:
   </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;HTML&gt;
&lt;BODY&gt;
Hei $asiakas.Nimi!
&lt;table&gt;
#foreach( $kura in $kuratTarjouksessa )
   #if ( $asiakas.onOstanut($kura) )
      &lt;tr&gt;
        &lt;td&gt;
          $tarjous.haePromo( $kura )
        &lt;/td&gt;
      &lt;/tr&gt;
   #end
#end
&lt;/table&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    <em>foreach</em> lauseen toiminta kuvataan yksityiskohtaisemmin
    jljempn; trke tss on tmn lyhyen skriptin tekem vaikutus
    sivullesi. Kun Kirkkaanpunainen Kura on alennusmyynniss ja sit
    joskus aiemmin ostanut asiakas kirjautuu sisn, asiakas nkee
    ilmoituksen alennuksesta parhaalla mahdollisella paikalla. Jos
    toinen, Terracottakuraa ostanut asiakas kirjautuu jrjestelmn,
    ilmoitus Terracottakuran alennusmyynnist nkyy hnelle
    ensimmisen. Velocity on joustava ja sen kytss vain
    mielikuvituksesi on rajana.
   </p>
                                                <p>
    VTL hakemistossa on kuvattu Velocityn kaikki elementit jotka
    yhdess antavat kyttsi tehokkaan ja joustavan tykalun jota
    tarvitset luodaksesi web sivuistasi dynaamisen. Pset
    hydyntmn Velocityn voimaa jatkuvasti paremmin sit mukaa kun
    opit kyttmn nit elementtej.
   </p>
                            </blockquote>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Velocity Template Language (VTL): Johdanto"><strong>Velocity Template Language (VTL): Johdanto</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Velocityn sivunkuvauskieli (Velocity Template Language, VTL)
    tarjoaa helpon ja yksinkertaisen keinon liitt dynaamista
    sislt web sivulle. Dynaamisen sislln kyttminen pitisi
    onnistua nopeasti jopa sellaiselta sivusuunnittelijalta jolla on
    ohjelmointikokemusta vain vhn, tai ei ollenkaan.
 </p>
                                                <p>
     VTL kytt <em>viittauksia</em> dynaamisen aineiston lismiseen
     verkkosivulle. Muuttujat ovat yhdentyyppisi
     viittauksia. Muuttujat voivat viitata johonkin java -koodissa
     mriteltyyn, tai niiden arvo voidaan mritt web -sivulla
     annetun VTL <em>lauseen</em> avulla. Seuraavassa on esimerkki VTL
     lauseesta joka voidaan list HTML -dokumenttiin:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $a = &quot;Velocity&quot; )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kuten kaikki VTL lauseet (statement), tmkin lause alkaa <em>#</em>
    merkill ja sislt ohjeen (directive): <em>set</em>. Kun verkkosivun
    kyttj hakee sivun Velocity etsii sivupohjastasi kaikki
    <em>#</em> -merkit. Sitten se tulkitsee mitk niist merkitsevt
    VTL lausetta, ja mitk <em>#</em> merkeist ovat osa sivujesi
    normaalia HTML -koodia, eivtk kuulu VTL -koodiin.
 </p>
                                                <p>
    <em>#</em> merkki seuraa ohje, <em>set</em>. <em>set</em> ohjeen
    jlkeen tulee suluissa ilmaus (expression), -- yhtl joka mritt
    <em>arvon</em> <em>muuttujalle</em>. Muuttuja on ilmaistu
    vasemmalla ja arvo oikealla puolella. Nm on erotettu <em>=</em>
    merkill.
 </p>
                                                <p>
    Yll olevassa esimerkiss muuttuja on <em>$a</em> ja arvo on
    <em>Velocity</em>. Kaikkien viittausten tapaan tmkin muuttuja
    alkaa <em>$</em> merkill. Arvot ovat aina lainausmerkkien
    sisll; Velocityss muuttujien datatyypeist ei tule
    sekaannuksia, koska vain merkkijonoja (string) voi antaa
    muuttujien arvoksi.
 </p>
                                                <p>
    Seuraava nyrkkisnt voi auttaa ymmrtmn Velocityn toimintaa:
    <strong>Viittaukset alkavat <em>$</em> merkill ja niit kytetn
    jonkin hakemiseen. Ohjeet alkavat <em>#</em> merkill ja niit
    kytetn jonkin suorittamiseen.</strong>
 </p>
                                                <p>
     Yll olevassa esimerkiss <em>#set</em> -ohjetta kytetn arvon
     mrittmiseksi muuttujaan. Muuttujaa <em>$a</em> voidaan tmn
     jlkeen kytt sivupohjassa tulostamaan "Velocity".
 </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Hei Velocity Maailma!"><strong>Hei Velocity Maailma!</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Kun muuttujalle on mritelty arvo, voidaan siihen viitata miss
    tahansa paikassa HTML dokumenttia. Seuraavassa esimerkiss
    muuttujalle <em>$foo</em> mritelln arvo. Myhemmin muuttujaan
    viitataan.
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;html&gt;
&lt;body&gt;
#set( $foo = &quot;Velocity&quot; )
Hei $foo Maailma!
&lt;/body&gt;
&lt;html&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tuloksena on web sivu jossa lukee "Hei Velocity Maailma!".
 </p>
                                                <p>
    Jotta VTL lauseet olisivat helpommin luettavissa on suositeltavaa
    aloittaa jokainen lause uudelta rivilt, vaikkakaan tm ei ole
    pakollista. <em>set</em> ohjeeseen palaamme tarkemmin myhemmin.
 </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Kommentit"><strong>Kommentit</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Kommenttien avulla sivulle voidaan list aputekstej jotka eivt
    tule nkymn sivun tulosteessa. Voit kytt kommentteja
    muistuttaaksesi itsesi jostakin tai selittksesi muille mit VTL
    komennot tekevt, tai mihin tahansa muuhun tarkoitukseen. Alla on
    esimerkki kommentin kytst.
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
## Tm on rivin pituinen kommentti.
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Yhden rivin pituinen kommentti alkaa <em>##</em> merkeill ja
    loppuu kyseisen rivin lopussa. Jos aiot kirjoittaa usean rivin
    mittaisen kommentin, ei sinun tarvitse kirjoittaa useita yhden
    rivin kommentteja. Usean rivin kommentit alkavat <em>#*</em>
    merkeill ja loppuvat <em>*#</em> merkkeihin.
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Tm teksti on kommenttimerkkien ulkopuolella.
Kyttjt nkevt tmn tekstin.

#*
 Monirivinen kommentti alkaa tst. Kyttjt eivt ne tt teksti
 koska Velocityn sivumoottori ei nyt kommenttimerkkien sisll
 olevaa teksti tulosteessaan.
*#

Tm teksti on jlleen kommenttimerkkien ulkopuolella; se on
nkyviss.

</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tss on muutamia esimerkkej yksi- ja monirivisten kommenttien
    toiminnan selvittmiseksi:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Tm teksti on nkyviss. ## Tm teksti ei ole.
Tm teksti on nkyviss.
Tm teksti on nkyviss. #* Tm teksti on osa monirivist kommenttia
eik siksi ole nkyviss. Tm teksti ei edelleenkn ole nkyviss
koska se on kommenttimerkkien sisll. *# Tm teksti on
kommenttimerkkien ulkopuolella, joten se on nkyviss.
## Tm teksti ei ole nkyviss.
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    On olemassa viel kolmaskin kommenttityyppi; VTL kommenttilohko,
    jota voidaan kytt mm. dokumentin tekij- ja versiotietojen
    tallettamiseen
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#**
Tm on VTL kommenttilohko. Lohkoa
voidaan kytt esimerkiksi dokumentin
tekij- ja versiotietojen
tallettamiseen:
@author
@version 5
*#
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Viittaukset"><strong>Viittaukset</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    VTL:ss on kolme erityyppist viittausta: muuttujat, ominaisuudet
    ja metodit. VTL: kyttvn sivusuunnittelijana sinun, ja
    javapuolta koodaavien ohjelmoijien on sovittava viittausten
    nimist, jotta voit kytt niit sivupohjissasi.
 </p>
                                                <p>
    Kaikkea viittauksissa olevaa ja niihin mriteltv tietoa
    ksitelln tekstityyppisen. Jos on esimerkiksi mritelty
    objekti <em>$foo</em> (Integer objekti), Velocity kutsuu objektin
    <code>.toString()</code> metodia objektin arvon muuntamiseksi
    tekstityyppiseksi.
 </p>
                                                <p>
 <a name="Muuttujat"><strong>Muuttujat</strong></a>
 <br />

    Muuttujan lyhyt merkinttapa koostuu ensimmisen olevasta "$"
    merkist, jonka jlkeen tulee VTL <em>tunniste</em>. VTL
    tunnisteen on alettava aakkosnumeerisella merkill (a..z tai
    A..Z). Muuttujan loput merkit ovat rajoitettu seuraaviin:

 </p>
                                                <p> 
   <ul>
     <li>aakkoset (a .. z, A .. Z)</li>
     <li>numerot (0 .. 9)</li>
     <li>viiva ("-")</li>
     <li>alaviiva ("_")</li>
   </ul>
 </p>
                                                <p>
    Seuraavassa muutamia esimerkkej toimivista muuttujaviittauksista:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$foo
$kuraLinko
$kura-linko
$kura_linko
$kuraLinko1
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kun VTL viittaa muuttujaan, kuten <em>$foo</em>, muuttuja voi
    saada arvonsa joko sivupohjassa olevalta <em>set</em> ohjeelta,
    tai java -koodista. Jos esimerkiksi javamuuttujalla <em>$foo</em>
    on arvo <em>bar</em> silloin kun sivupohjaa haetaan, <em>bar</em>
    korvaa kaikki <em>$foo</em> muuttujan esiintymiskohdat web
    sivulla. Toisaalta jos sivulle listn lause
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $foo = &quot;bar&quot; )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Sivun tuloste on sama kaikilla <em>$foo</em> muuttujan
    esiintymiskohdille jotka tulevat tmn lauseen jlkeen.
 </p>
                                                <p>
 <a name="Ominaisuudet"><strong>Ominaisuudet</strong></a>
 <br />

    Toinen VTL:n viittaustyyppi ovat ominaisuudet joilla on oma
    tunnusomainen muotonsa. Lyhyt merkinttapa muodostuu ensimmisen
    olevasta <em>$</em> merkist, jonka jlkeen tulee VTL tunniste,
    jota seuraa piste (".") ja toinen VTL tunniste. Seuraavassa on
    esimerkkej toimivista ominaisuusviittauksista:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$asiakas.Osoite
$ostos.Summa
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Ksittelemme ensimmisen esimerkin <em>$asiakas.Osoite</em>
    tarkemmin. Viittauksella voi olla kaksi merkityst. Se saattaa
    tarkoittaa; hae <em>asiakas</em> nimisest hashtable taulukosta
    arvo joka on liitetty avaimelle <em>Osoite</em>. Toisaalta
    <em>$asiakas.Osoite</em> voi mys viitata metodiin (ksittelemme
    metodeihin viittaavat viittaukset seuraavassa kappaleessa);
    <em>$asiakas.Osoite</em> saattaa olla lyhennetty muoto
    viittauksesta <em>$asiakas.getOsoite()</em>. Velocity tulkitsee
    sivua haettaessa kumpaa nist vaihtoehdoista tarkoitetaan, ja
    palauttaa vastaavan arvon.
 </p>
                                                <p>
 <a name="Metodit"><strong>Metodit</strong></a>
 <br />

    Metodit ovat mritelty java -koodissa ja niiden avulla voidaan
    suorittaa jokin toimenpide; esimerkiksi laskutoimitus tai jonkin
    ptksen tekeminen. Metodit ovat viittauksia jotka muodostuvat
    aloittavasta "$" merkist, jota seuraa VTL tunniste, jonka jlkeen
    tulee VTL <em>Metodirunko</em>. VTL Metodirunko koostuu VTL
    tunnisteesta jota seuraa vasen sulkumerkki "(", jota seuraa
    valinnainen parametrilista, jota seuraa oikeanpuoleinen
    sulkumerkki ")". Seuraavassa on esimerkkej toimivista
    metodiviittauksista:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$asiakas.getOsoite()
$ostos.getSumma()
$sivu.setOtsake( &quot;Minun kotisivuni&quot; )
$henkilo.setOminaisuudet( [&quot;Outo&quot;, &quot;Kummallinen&quot;, &quot;Innostunut&quot;] )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Metodirungossa esiintyv get tarkoittaa "hae" ja set "aseta".
 </p>
                                                <p>
    Kaksi ensimmist esimerkki -- <em>$asiakas.getOsoite()</em> ja
    <em>$ostos.getSumma()</em> -- nyttvt samanlaisilta kuin
    Ominaisuudet -osiossa aiemmin; <em>$asiakas.Osoite</em> ja
    <em>$ostos.Summa</em>. Jos arvasit ett nill esimerkeill on
    jotakin yhteytt toisiinsa, olit oikeassa!
 </p>
                                                <p>
    VTL ominaisuuksia voidaan kytt lyhyempin muotoina VTL
    metodeista. Ominaisuudella <em>$asiakas.Osoite</em> on tysin sama
    vaikutus kuin kyttmll metodia
    <em>$asikas.getOsoite()</em>. Yleisesti ottaen ominaisuuksien
    kytt on suositeltavaa silloin kuin se vain on
    mahdollista. Suurin ero ominaisuuksien ja metodien vlill on se,
    ett metodeille voi antaa parametreja.
 </p>
                                                <p>
    Seuraavien metodien kanssa voidaan kytt lyhytt muotoa:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$aurinko.getPlaneetat()
$mato.getMulta()
$albumi.getValokuva()
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Niden metodien voisimme olettaa palauttavan auringolle kuuluvien
    planeettojen nimet, syttvn matomme, tai hakevan valokuvan
    albumista. Seuraavissa metodeissa toimii vain pitk muoto:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$aurinko.getPlaneetat( [&quot;Maa&quot;, &quot;Mars&quot;, &quot;Neptunus&quot;] )
## lyhyess muodossa $sun.Planets ei voida antaa parametreja

$sisyphus.pushRock()
## Velocity olettaa ett tarkoitan $sisyphus.getRock()

$kirja.setOtsake( &quot;Catalonian kotisivu&quot; )
## Parametrilistaa ei voida antaa
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    <a name="Muodollinen viittausten merkint"><strong>Muodollinen viittausten merkint</strong></a>
    <br />

    Edellisiss esimerkeiss kytettiin viittauksille lyhytt
    merkinttapaa. Viittauksille on olemassa mys muodollinen
    merkinttapa, jota kytetn seuraavissa esimerkeiss:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
${kuraLinko}
${asiakas.Osoite}
${osto.getSumma()}
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Voit kytt lyhytt muotoa viittauksiin lhes aina, mutta
    joissain tapauksissa muodollista viittausta tarvitaan virheettmn
    toiminnan turvaamiseksi.
 </p>
                                                <p>
    Oletetaan ett olet luomassa lausetta jonka sislt riippuu
    muuttujasta. Muuttujaa <em>$pahe</em> kytetn pohjana luotaessa
    muuttujasta riippuvaista sanaa. Tarkoituksena on sallia kyttjn
    valita pohjasana ja tuottaa toinen seuraavista tuloksista: "Juha
    on pyromaani." tai "Juha on kleptomaani.". Tss tapauksessa
    lyhyen viittausmuodon kyttminen ei toimisi. Tutki seuraavaa
    esimerkki:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Juha on $pahemaani.
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Velocity olettaa ett tarkoitat muuttujaa <em>$pahemaani</em>,
    vaikka kytettv muuttuja oli <em>$pahe</em>. Koska Velocity ei
    lyd arvoa muuttujalle <em>$pahemaani</em>, se palauttaa
    <em>$pahemaani</em>. Tm ongelma voidaan ratkaista kyttmll
    muodollista viittausta.
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Juha on ${pahe}maani.
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Nyt Velocity ymmrt ett haluttu viittaus on <em>$pahe</em>, ei
    <em>$pahemaani</em>. Muodollinen viittausten merkint on usein
    hydyllinen silloin kun viittaukset ovat kiinni muussa tekstiss.
 </p>
                                                <p>
    <a name="Hiljainen viittausten merkint"><strong>Hiljainen viittausten merkint</strong></a>
    <br />
    Kun Velocitylt haetaan viittaus jolle ei ole mritelty arvoa,
    palauttaa se normaalisti viittauksen tekstin. Oletetaan
    esimerkiksi ett seuraavat viittaukset ovat osa VTL sivupohjaa:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;$email&quot;/&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kun lomake latautuu ensimmisen kerran muuttujaviittauksella
    <em>$email</em> ei ole arvoa. Oletuksena Velocity tytt
    lomakkeen tekstill "$email". Haluaisit kuitenkin kenttn
    mieluummin tyhjn arvon. Kyttmll hiljaista viittausten
    merkint voidaan Velocityn normaali toiminta est;
    <em>$email</em> koodin sijaan kytt viittausta
    <em>$!email</em>. Yll oleva koodi nyttisi siis seuraavalta:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;$!email&quot;/&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kun lomake latautuu ensimmisen kerran eik muuttujalla
    <em>$email</em> ole arvoa, tulostetaankin kenttn tyhj teksti
    "$email" tekstin sijaan.
 </p>
                                                <p>
    Muodollista ja hiljaista muuttujien merkint voidaan kytt mys
    yhdess;
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;$!{email}&quot;/&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Kirjaimellisesti"><strong>Kirjaimellisesti</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    VTL kytt erikoismerkkej kuten <em>$</em> ja <em>#</em> omassa
    toiminnassaan, joten niden merkkien kytt sivupohjassa vaatii
    erityist huolellisuutta. Tss kappaleessa ksittelemme
    <em>$</em> merkin suojaamisen (escape).
  </p>
                                                <p>
    <a name="Dollari"><strong>Dollari</strong></a>
    <br />

    Seuraavassa lauseessa dollarimerkin kytss ei ole ongelmaa:
    "Ostin markkinoilta skin perunoita hintaan $2.50!". Kuten
    mainittu, VTL tunniste alkaa aina aakkosmerkill, joten merkint
    $2.50 ei ole vaaraa sekoittaa viittaukseksi.
  </p>
                                                <p>
    <a name="VTL viittausten suojaaminen"><strong>VTL viittausten suojaaminen</strong></a>
    <br />

    Ongelmatilanne saattaa synty silloin, kun Velocity ei osaa
    ptell tarkoitetaanko dollarinmerkill merkki itsen, vai
    viittausta. Erikoismerkkien <em>suojaaminen</em> on paras keino
    ksitell VTL erikoismerkkej sivupohjissa. Suojaamiseen kytetn
    kenoviivaa ( <em>\</em> ).
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $email = &quot;foo&quot; )
$email
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kun Velocity ksittelee <em>$email</em> viittauksen
    sivupohjassasi, se etsii lytyyk sen nimiselle muuttujalle
    arvoa. Tss tapauksessa tuloste tulee olemaan <em>foo</em>, koska
    <em>$email</em> on mritelty. Jos <em>$email</em> muuttujaa ei
    olisi mritelty tulisi tulosteeksi <em>$email</em>.
  </p>
                                                <p>
    Oletetaan ett <em>$email</em> on mritelty (sill on esimerkiksi
    arvo <em>foo</em>), ja ett haluat muuttujan arvon sijaan tulostaa
    sen nimen <em>$email</em>. Tm saavuttamiseksi on useita keinoja,
    joista helpoin on suojausmerkin kyttminen.
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
## Seuraava rivi mrittelee muuttujan $email tss sivupohjassa:
#set( $email = &quot;foo&quot; )
$email
\$email
\\$email
\\\$email
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     tulosteeksi tulee
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
foo
$email
\foo
\\$email
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     Huomaa <em>$</em> merkin eteen liitetty <em>\</em>
     merkki. Suojausmerkit tulkitaan vasemmalta oikealle, joten
     <em>\\\$email</em> tulostuu <em>\\$email</em>. Vertaa nit
     esimerkkej tulosteeseen joka saadaan kun <em>$email</em>
     muuttujaa ei ole mritelty.
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$email
\$email
\\$email
\\\$email
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     tulosteeksi tulee
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$email
\$email
\\$email
\\\$email
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     Huomaa kuinka Velocity ksittelee eri tavalla viittaukset joiden
     arvo on mritelty niist joita ei ole mritelty. Seuraavassa on
     set ohje joka asettaa <em>$foo</em> muuttujalle arvon
     <em>gibbous</em>.
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $foo = &quot;gibbous&quot; )
$kuu = $foo
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tulosteeksi tulee: <em>$kuu = gibbous</em> -- miss <em>$kuu</em>
    tulostetaan muuttujan nimen, koska sen arvoa ei ole mritelty ja
    <em>gibbous</em> tulostetaan muuttujan <em>$foo</em> arvona.
  </p>
                                                <p>
     Mys VTL ohjeiden suojaaminen on mahdollista; tm kuvataan
     tarkemmin Ohjeet -kappaleessa.
  </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Kirjainkoon muutos"><strong>Kirjainkoon muutos</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Kun nyt olet tutustunut viittauksiin, voit alkaa kyttmn niit
    tehokkaasti omissa sivupohjissasi. Viittaukset Velocityss
    kyttvt hyvkseen joitakin java kielen perusperiaatteita, joiden
    kytt helpottaa sivusuunnittelijoiden tyt. Esimerkiksi:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$foo

$foo.getBar()
## on sama kuin
$foo.Bar

$data.getKayttaja(&quot;juha&quot;)
## on sama kuin
$data.Kayttaja(&quot;juha&quot;)

$data.getPyynto().getPalvelinNimi()
## on sama kuin
$data.Pyynto.PalvelinNimi
## on sama kuin
${data.Pyynto.PalvelinNimi}
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Nm esimerkit havainnollistavat viittauksen vaihtoehtoisia
    merkitsemistapoja. Velocity kytt hyvkseen javan introspection
    ja bean -ominaisuuksia objektien sek niiden metodien
    viittausnimi ratkaistaessa. Viittauksia voidaan list lhes
    mihin kohtaan tahansa sivupojassa.
    </p>
                                                <p>
    Velocity on tehty Sun Microsystemsin mrittelemn Bean
    mrityksen mukaiseksi, ja on tst syyst pieni-iso-eroava
    (ts. pienet ja isot kirjaimet ksitelln eri
    merkkein). Velocityn kehittjt ovat tehneet parhaansa jotta
    mahdolliset kirjoitusvirheet voitaisiin korjata
    automaattisesti. Kun sivupohjassa viitataan metodiin
    <em>getFoo()</em> koodilla <code>$bar.foo</code>, Velocity
    kokeilee ensin viittausta <code>$getfoo</code>. Jos tm ei tuota
    tulosta, seuraavaksi yritetn viittausta
    <code>$getFoo</code>. Samalla tavalla, kun sivupohjassa viitataan
    muuttujaan <code>$bar.Foo</code>, ensin yritetn viittausta
    <em>$getFoo()</em> ja sitten <em>getfoo()</em>.
    </p>
                                                <p>
    Huomaa: <em>Viittauksia ilmentymmuuttujiin (instance variables)
    ei ratkaista.</em> Vain viittaukset JavaBeanin mukaisiin
    haku/asetus (getter/setter) metodeihin ratkaistaan (toisin sanoen
    <code>$foo.Name</code> ratkaistaan Foo -luokan
    <code>getName()</code> ilmentymmetodiin (instance method), mutta
    ei luokan Foo julkiseen (public) <code>Name</code>
    ilmentymmuuttujaan).
    </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Ohjeet"><strong>Ohjeet</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    <em>Ohjeet</em> ovat helppokyttisi skriptielementtej joita
    voidaan kytt web sivun tulosteen manipuloimiseen. Viittausten
    avulla sivupohjien suunnittelijat voivat tuottaa web sivuille
    dynaamista sislt, kun taas ohjeet antavat mahdollisuuden
    mritell sivuston ulkoasun ja sislln.
 </p>
                                                <a name="Set"><strong>#set</strong></a>
                                                <p>
    <em>#set</em> ohjetta kytetn arvon mrittmiseksi
    viittaukselle. Arvo voidaan mritt joko muuttujaviittaukselle
    tai ominaisuusviittaukselle. Mritys tehdn suluissa, kuten
    seuraavassa esimerkiss:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $kadellinen = &quot;apina&quot; )
#set( $asiakas.Kayttaytyminen = $kadellinen )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Mrityksen vasemman puolen (left hand side, LHS) tulee olla
    muuttuja- tai ominaisuusviittaus. Oikea puoli (right hand side,
    RHS) voi olla jokin seuraavista tyypeist:
 </p>
                                                <p>
    <ul>
        <li>Muuttujaviittaus</li>
        <li>Tekstivakio</li>
        <li>Ominaisuusviittaus</li>
        <li>Metodiviittaus</li>
        <li>Numeerinen vakio</li>
        <li>ArrayList taulukko</li>
    </ul>
 </p>
                                                <p>
    Seuraavassa esimerkit kustakin mainitusta tyypist:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $apina = $bill ) ## muuttujaviittaus
#set( $apina.Ystava = &quot;monica&quot; ) ## tekstivakio
#set( $apina.Syytos = $valkoinentalo.vuoto ) ## ominaisuusviittaus
#set( $apina.Suunnitelma = $spindoctor.weave($web) ) ## metodiviittaus
#set( $apina.Numero = 123 ) ## numeerinen vakio
#set( $apina.Sano = [&quot;Ei&quot;, $minun, &quot;vikani&quot;] ) ## taulukko
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
   HUOMAA: Viimeisess esimerkiss [..] operaattorilla mritetyt
   elementit ovat kytettviss ArrayList -luokan metodien
   avulla. Voisit siis esimerkiksi viitata taulukon ensimmiseen
   elementtiin koodilla $apina.Sano.get(0).
 </p>
                                                <p>
    Oikeanpuoleinen arvo (RHS) voi olla mys yksinkertainen
    matemaattinen operaatio:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $arvo = $foo + 1 )
#set( $arvo = $bar - 1 )
#set( $arvo = $foo * $bar )
#set( $arvo = $foo / $bar )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Jos mrityksen oikeanpuoleinen ominaisuus- tai metodiviittaus on
    arvoa <em>null</em>, sit <b>ei</b> anneta vasemman puolen
    arvoksi. Tt keinoa ei voida kytt olemassa olevan viittauksen
    poistamiseen. Tm saattaa olla hmv Velocityn uusille
    kyttjille. Esimerkiksi:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $tulos = $kysely.kriteeri(&quot;nimi&quot;) )
Ensimmisen kyselyn tulos on $tulos

#set( $tulos = $kysely.kriteeri(&quot;osoite&quot;) )
Toisen kyselyn tulos on $tulos
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     Jos <em>$kysely.kriteeri("nimi")</em> palauttaa merkkijonon
     "pete", ja <em>$kysely.kriteeri("osoite")</em> palauttaa arvon
     <em>null</em>, on esimerkin tuloste seuraava:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Ensimmisen kyselyn tulos on pete

Toisen kyselyn tulos on pete
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     Tll on vaara hmt aloittelijoita jotka muodostavat
     <em>#foreach</em> silmukoita joissa yritetn asettaa
     <em>#set</em> ohjeella viittausta ominaisuus- tai
     metodiviittauksella, ja sen jlkeen testataan tuota viittausta
     <em>#if</em> ohjeella. Esimerkiksi:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>

#set( $kriteerit = [&quot;nimi&quot;, &quot;osoite&quot;] )

#foreach( $kriteeri in $kriteerit )

    #set( $tulos = $kysely.kriteerit($kriteeri) )

    #if( $tulos )
        Kysely onnistui
    #end

#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     Yll olevassa esimerkiss ei kannata luottaa <em>$tulos</em>
     muuttujan vertaamiseen kyselyn onnistumisen selville
     saamiseksi. Kun <em>$tulos</em> on asetettu <em>#set</em>
     ohjeella (lisatty kontekstiin), sit ei voida asettaa
     <em>null</em>:iksi (poistaa kontekstista). <em>#if</em> ja
     <em>#foreach</em> ohjeet ksitelln tarkemmin myhemmin tss
     dokumentissa.
 </p>
                                                <p>
   Yksi ratkaisu ongelmaan olisi asettaa <em>$tulos</em> etukteen
   arvoon <em>false</em> (eptosi). Tmn jlkeen jos kutsu
   <em>$kysely.kriteeri()</em> eponnistuu, voit tarkastaa arvon.
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>

#set( $kriteerit = [&quot;nimi&quot;, &quot;osoite&quot;] )

#foreach( $kriteeri in $kriteeri )

    #set( $tulos = false )
    #set( $tulos = $kysely.kriteerit($kriteeri) )

    #if( $tulos )
        Kysely onnistui
    #end

#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Muutamista muista Velocityn ohjeista poiketen, <em>#set</em> ohje
    ei kyt <em>#end</em> lausetta.
 </p>
                                                <a name="Tekstivakiot"><strong>Tekstivakiot</strong></a>
                                                <p>
    <em>#set</em> ohjetta kytettess lainausmerkkeihin (" ")
    suljettu teksti tulkitaan ja tulostetaan kuten seuraavasta
    esimerkist ky ilmi:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $hakemistoJuuri = &quot;www&quot; )
#set( $sivupohjaNimi = &quot;index.vm&quot; )
#set( $sivupohja = &quot;$hakemistoJuuri/$sivupohjaNimi&quot; )
$sivupohja
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Tulosteeksi tulee
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
www/index.vm
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Jos teksti on suljettu hipsuihin (' '), sit ei tulkita:
 </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $foo = &quot;bar&quot; )
$foo
#set( $blargh = '$foo' )
$blargh
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
  bar
  $foo
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tulkitsemattoman tekstin tulostaminen hipsumerkkien sisll
    olevavasta tekstist on oletuksena kytss
    Velocityss. Oletusarvo voidaan muuttaa vaihtamalla
    <code>velocity.properties</code> siten ett
    <code>stringliterals.interpolate=false</code>.
 </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="If-Else ehtolauseet"><strong>If-Else ehtolauseet</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <strong>If / ElseIf / Else</strong>
                                                <p>
       <em>#if</em> ohjeen avulla voidaan teksti sisllytt web
       sivulle sill ehdolla ett if lauseen arvo on
       tosi. Esimerkiksi:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#if( $foo )
   &lt;strong&gt;Velocity!&lt;/strong&gt;
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
      Muuttuja <em>$foo</em> testataan jotta nhdn onko se tosi,
      joka tapahtuu kahdessa eri tapauksessa: (i) <em>$foo</em> on
      boolean arvo (tosi/eptosi) jolla on tosi -arvo, tai (ii) arvo
      on eri kuin null (eli muuttuja ei ole tyhj). <em>#if</em> ja
      <em>#end</em> lauseiden vliin jv sislt tulostetaan mikli
      testimuuttuja on tosi. Esimerkkitapauksessamme, jos muuttujalla
      <em>$foo</em> on null arvo, tai jos se on boolean eptosi, on
      testimuuttuja eptosi, eik tulostetta tule lainkaan.
    </p>
                                                <p>
      <em>#if</em> ja <em>#end</em> lauseiden vliss oleva teksti
      tulee tulosteeksi mikli ehto on tosi. Tss tapauksessa jos
      <em>$foo</em> on tosi, tulosteeksi tulee:
      "Velocity!". Toisaalta, mikli <em>$foo</em> on eptosi, on mys
      ehtolause eptosi eik tulostetta tule.
    </p>
                                                <p>
      <em>#elseif</em> tai <em>#else</em> elementtej voidaan kytt
      <em>#if</em> elementin kanssa. Huomaa, ett Velocityn
      sivumoottori lopettaa ensimmisen tosiarvon saaneen
      testimuuttujan kohdalla. Oletetaan seuraavassa esimerkiss ett
      muuttujalla <em>$foo</em> on arvo 15 ja muuttujalla
      <em>$bar</em> on arvo 6.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#if( $foo &lt; 10 )
    &lt;strong&gt;Mene pohjoiseen&lt;/strong&gt;
#elseif( $foo == 10 )
    &lt;strong&gt;Mene itn&lt;/strong&gt;
#elseif( $bar == 6 )
    &lt;strong&gt;Mene eteln&lt;/strong&gt;
#else
    &lt;strong&gt;Mene lnteen&lt;/strong&gt;
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>Tss esimerkiss <em>$foo</em> on suurempi kuin 10, joten
    kaksi ensimmist vertailua eivt ole tosia. Seuraavaksi muuttujaa
    <em>$bar</em> verrataan lukuun 6, joka on tosi, joten tulosteeksi
    tulee <strong>Mene eteln</strong>.
    </p>
                                                <p>
    Huomaa, ett nykyiselln Velocityn numeeriset vertailut on
    rajoitettu Integer (kokonais-) lukuihin. Kaikki muut arvot
    tulkitaan <em>eptosi</em>ksi. Ainoa poikkeus thn on vastaavuus
    '==', jolloin Velocity vaatii ett objektit vertailun kummallakin
    puolella ovat <em>samaa</em> luokkaa.
    </p>
                                                <p>
    <a name="Relaatio- ja loogiset operaattorit"><strong>Relaatio- ja
    loogiset operaattorit</strong></a>
    </p>
                                                <p>
    Velocity kytt vastaavuusoperaattoria muuttujien vlisten
    suhteiden tulkitsemiseen. Seuraavassa on yksinkertainen esimerkki
    vastaavuusoperaattorin kytst.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set ($foo = &quot;deoksiribonukleiinihappo&quot;)
#set ($bar = &quot;ribonukleiinihappo&quot;)

#if ($foo == $bar)
  Muuttujat eivt selvstikn ole samanlaiset. Joten...
#else
  Vastaavuusvertaus on eptosi, ja tm teksti tulee tulosteeksi.
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
      Velocity tukee mys loogisia AND ja OR
      operaattoreita. Listietoja lydt dokumentista <a href="vtl-reference-guide.html">VTL Reference Guide</a>. Alla on
      esimerkkilause joka kytt loogista AND:i.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>

## looginen AND

#if( $foo &amp;&amp; $bar )
   &lt;strong&gt; Tm JA tuo&lt;/strong&gt;
#end

</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
      If lause on tosi vain mikli sek <em>$foo</em> ett
      <em>$bar</em> ovat tosia. Jos <em>$foo</em> on eptosi, tulee
      lauseesta eptosi eik <em>$bar</em> muuttujaa tarvitse edes
      testata. Jos <em>$foo</em> on tosi, testataan sen jlkeen
      muuttujan <em>$bar</em> arvo; jos mys <em>$bar</em> on tosi,
      silloin koko ilmaus on tosi ja <strong>Tm JA tuo</strong>
      tulee tulosteeksi. Jos <em>$bar</em> on eptosi, silloin koko
      ilmaus on eptosi eik tulostetta tule.
    </p>
                                                <p>
      Looginen OR operaattori toimii samaan tapaan, paitsi ett vain
      toisen viittauksen pit olla tosi jotta koko ilmaus olisi
      tosi. Katso seuraavaa esimerkki.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>

## looginen OR

#if( $foo || $bar )
    &lt;strong&gt;Tm TAI tuo&lt;/strong&gt;
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
      Jos <em>$foo</em> on tosi, ei <em>$bar</em> muuttujaa tarvitse
      edes testata. Oli <em>$bar</em> sitten tosi tai eptosi, koko
      lauseke on tosi, ja <strong>Tm TAI tuo</strong> on
      tulosteena. Toisaalta mikli <em>$foo</em> on eptosi, on
      muuttujan <em>$bar</em> arvo testattava. Jos tss tapauksessa
      mys <em>$bar</em> on eptosi, koko ilmauksesta tulee eptosi
      eik tulostetta tule. Jos <em>$bar</em> on tosi, silloin koko
      ilmauksesta tulee tosi, ja tulosteena on <strong>Tm TAI
      tuo</strong>.
    </p>
                                                <p>
    Loogisella EI (NOT) operaattorilla on vain yksi argumentti :
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>

## looginen NOT

#if( !$foo )
  &lt;strong&gt;EI tuota&lt;/strong&gt;
#end

</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Jos <em>$foo</em> on tosi, silloin <em>!$foo</em> on eptosi, eik
    tulostetta tmn vuoksi tule. Mikli <em>$foo</em> on eptosi,
    silloin <em>!$foo</em> on tosi ja <strong>EI tuota</strong> on
    tulosteena. l sekoita tt merkint <em>hiljaiseen viittaukseen
    $!foo</em> joka tarkoittaa jotakin aivan muuta.
    </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Silmukat"><strong>Silmukat</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <strong>Foreach silmukat</strong>
                                                <p>
      <em>#foreach</em> mahdollistaa silmukoiden tekemisen. Esimerkiksi:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;ul&gt;
#foreach( $tuote in $kaikkiTuotteet )
    &lt;li&gt;$tuote&lt;/li&gt;
#end
&lt;/ul&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tm <em>#foreach</em> silmukka ky lpi yksi kerrallaan kaikki
    <em>$kaikkiTuotteet</em> listassa olevat tuotteet. Jokaisella
    kierroksella seuraavan tuotteen arvo kopioidaan
    <em>$kaikkiTuotteet</em> listasta muuttujaan <em>$tuote</em>.
    </p>
                                                <p>
    <em>$kaikkiTuotteet</em> lista on tyyppi Vector, Hashtable tai
    Array. <em>$tuote</em> muuttujaan kopioitu arvo on java objekti
    (Object), joten siihen voidaan mys viitata objektina. Jos
    esimerkiksi <em>$tuote</em> muuttuja olisi tyyppi Tuote, sen nimi
    voitaisiin hakea viittaamalla <em>$tuote.Name</em> metodiin
    (ts. <em>$Tuote.getName()</em>.
    </p>
                                                <p>
    Oletetaan ett <em>$kaikkiTuotteet</em> on tyyppi Hashtable. Jos
    haluat hakea Hashtablen avainarvot sek niihin liittyvt objektit,
    voit kytt seuraavanlaista koodia:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;ul&gt;
#foreach( $avain in $kaikkiTuotteet.keySet() )
    &lt;li&gt;Avain: $avain -&gt; Arvo: $kaikkiTuotteet.get($avain)&lt;/li&gt;
#end
&lt;/ul&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Velocityll on helppo keino silmukkalaskurin kyttmiseen. Voit
    kytt laskuria esimerkiksi seuraavasti:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;table&gt;
#foreach( $asiakas in $asiakasLista )
    &lt;tr&gt;&lt;td&gt;$velocityCount&lt;/td&gt;&lt;td&gt;$asiakas.Nimi&lt;/td&gt;&lt;/tr&gt;
#end
&lt;/table&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Silmukkalaskurin oletusnimi on $velocityCount ja se mritetn
    velocity.properties tiedostossa. Oletuksena laskuri alkaa arvosta
    1, mutta aloitusarvo voidaan mritt olemaan joko 1 tai 0
    <code>velocity.properties</code>
    tiedostossa. <code>velocity.properties</code> tiedoston
    silmukkalaskuriosio nytt tlt:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
# Silmukkalaskurin oletusnimi
counter.name = velocityCount

# Silmukkalaskurin aloitusarvo
counter.initial.value = 1
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Include"><strong>Include</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    <em>#include</em> elementin avulla sivusuunnittelija voi hakea
    paikallisesta tiedostojrjestelmst tiedoston, jonka sislt
    listn sivun siihen kohtaan jossa <em>#include</em> mritys
    tehtiin. Tiedoston sislt liitetn sellaisenaan eik sit siis
    kytet Velocityn sivumoottorin kautta. Turvallisuussyist
    haettava tiedosto voi sijaita vain TEMPLATE_ROOT vakion
    mrittmn hakemiston alla.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#include( &quot;yksi.txt&quot; )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tiedosto johon <em>#include</em> ohje viittaa on
    lainausmerkeiss. Jos halutaan sisllytt useampia kuin yksi
    tiedosto, tiedostonimet tulee erotella toisistaan pilkuilla.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#include( &quot;yksi.gif&quot;,&quot;kaksi.txt&quot;,&quot;kolme.htm&quot; )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Sisllytettvn tiedoston ei ole pakko viitata nimen perusteella;
    itse asiassa usein on parempi kytt muuttujaa tiedostonimen
    asemesta. Tm on hydyllist esimerkiksi silloin kun sivun
    ulkoasu riippuu sivupyynnn aikana ptettvst
    ehdosta. Seuraavassa on esimerkki jossa kytetn sek
    tiedostonime ett muuttujaa.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#include( &quot;terveiset.txt&quot;, $sesonkivarasto )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Parse"><strong>Parse</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    <em>#parse</em> elementin avulla sivusuunnittelija voi sisllytt
    paikallisesta levyjrjestelmst tiedostoja jotka sisltvt VTL
    elementtej. Velocity tulkitsee VTL komennot ja tulostaa tuloksen.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#parse( &quot;mina.vm&quot; )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    <em>#include</em> ohjeen tapaan <em>#parse</em> voi ottaa
    parametrikseen nimen lisksi mys muuttujan. Kaikkien sivupohjien
    joihin <em>#parse</em> ohjeella viitataan tulee sijaita
    TEMPLATE_ROOT vakion mrittmn hakemiston
    alla. <em>#include</em> ohjeesta poiketen <em>#parse</em> voi
    ottaa vain yhden argumentin.
    </p>
                                                <p>
    VTL sivupohjissa voi olla <em>#parse</em> ohjeita jotka viittaavat
    sivupohjiin joissa niisskin on <em>#parse</em>
    ohjeita. <code>velocity.properties</code> tiedostossa oleva rivi
    <em>parse_directive.maxdepth</em> mritt sen kuinka monta
    perkkist <em>#parse</em> viittausta voidaan tehd. Mikli
    <em>parse_directive.maxdepth</em> mritys puuttuu, kytetn
    oletusarvoa 10. Rekursiivisuus on sallittu. Jos esimerkiksi
    sivupohja <code>dofoo.vm</code> sislt seuraavat rivit:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Laske alaspin.
#set( $laskuri = 8 )
#parse( &quot;parsefoo.vm&quot; )
Kaikki valmista: dofoo.vm!
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Koodi viittaisi sivupohjaan <code>parsefoo.vm</code>, jossa
    puolestaan voisi olla seuraavat VTL komennot:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$laskuri
#set( $laskuri = $laskuri - 1 )
#if( $laskuri &gt; 0 )
    #parse( &quot;parsefoo.vm&quot; )
#else
    Kaikki valmista: parsefoo.vm!
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kun "Laske alaspin." on nytetty, Velocity lataa ja siirt
    kontrollin sivupohjalle <code>parsefoo.vm</code>, joka laskee alas
    luvusta 8. Kun laskuri saavuttaa arvon 0, tulostetaan "Kaikki
    valmista: parsefoo.vm!". Tmn jlkeen Velocity palaa sivupohjaan
    <code>dofoo.vm</code> ja tulostaa "Kaikki valmista: dofoo.vm!"
    tekstin.
    </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Stop"><strong>Stop</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    <em>#stop</em> elementin avulla sivupohjan suunnittelija voi
    pysytt sivun tulkitsemisen. Tm on hydyllist sivupohjan
    virheidenetsinnn aikana.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#stop
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Velocimakrot"><strong>Velocimakrot</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    <em>#macro</em> elementin avulla sivupohjan suunnittelija voi
    mritt toistuvasti kytetyn VTL sivupohjan osan. Velocimakrot
    ovat erittin kyttkelpoisia sek monimutkaisissa, ett
    yksinkertaisissa tehtviss. Seuraava Velocimakro toimii
    johdantona Velocimakroihin. Se on luotu kirjoitettavan tekstin
    mrn vhentmiseksi, sek kirjoitusvirheiden mrn
    minimoimiseksi.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#macro( d )
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Esimerkiss mriteltiin Velocimakro nimeltn <em>d</em>, ja sit
    voidaan kutsua muiden VTL ohjeiden tapaan:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#d()
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kun tt sivupohjaa haetaan, Velocity korvaa ohjeen <em>#d()</em>
    rivill joka sislt yhden tyhjn solun.
    </p>
                                                <p>
    Velocimakro voi ottaa kuinka monta parametria tahansa -- tai ei
    yhtn parametria, kuten ensimmisess esimerkissmme -- mutta kun
    Velocimakroa kutsutaan, tulee kutsussa olla tsmlleen yht monta
    parametria kuin makroa mriteltess. Useimmat Velocimakrot ovat
    hieman monimutkaisempia kuin edellinen esimerkki. Seuraavassa on
    Velocimakro joka ottaa kaksi argumenttia; vrin ja listan.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#macro( taulurivit $vari $jokulista )
#foreach( $jotain in $jokulista )
    &lt;tr&gt;&lt;td bgcolor=$vari&gt;$jotain&lt;/td&gt;&lt;/tr&gt;
#end
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tss esimerkiss mriteltiin Velocimakro <em>taulurivit</em>
    joka ottaa kaksi parametria. Ensimminen parametri on
    <em>$vari</em> ja toinen <em>$jokulista</em>.
    </p>
                                                <p>
    Velocimakroon voidaan kirjoittaa mit tahansa koodia jota voidaan
    kytt muuallakin VTL sivupohjassa. <em>taulurivit</em>
    Velocimakro on <em>foreach</em> lause. <em>taulurivit</em>
    Velocimakrossa on kaksi <em>#end</em> lausetta; ensimminen kuuluu
    <em>#foreach</em> lauseelle, jlkimminen ptt Velocimakron
    mrityksen.
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $suuretjarvet = [&quot;Superior&quot;,&quot;Michigan&quot;,&quot;Huron&quot;,&quot;Erie&quot;,&quot;Ontario&quot;] )
#set( $vari = &quot;blue&quot; )
&lt;table&gt;
    #taulurivit( $vari $suuretjarvet )
&lt;/table&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Huomaa ett <em>$suuretjarvet</em> on makron parametrin
    <em>$jokulista</em> arvona. Kun Velocimakroa <em>#taulurivit</em>
    tss tapauksessa kutsutaan, on tuloksena seuraavaa:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;table&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;blue&quot;&gt;Superior&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;blue&quot;&gt;Michigan&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;blue&quot;&gt;Huron&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;blue&quot;&gt;Erie&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;blue&quot;&gt;Ontario&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Velocimakroja voidaan mritt <em>inline</em>, eli Velocity
    sivupohjassa itsessn, jolloin ko. makro ei ole kytettviss
    muissa sivupohjissa. Velocimakron mrittminen siten ett se on
    kaikkien sivupohjien kytss on hydyllist; samaa makroa ei
    tarvitse mritt erikseen jokaisessa sivupohjassa jossa sit
    tarvitaan, jolloin tymr ja virheiden mahdollisuus
    vhenee. Lisksi makroon tehty muutos vaikuttaa heti kaikkiin
    sivupohjiin joissa se on kytss.
    </p>
                                                <p>
    Oletetaan ett Velocityss on mriteltyn Velocimakro
    <em>#tablerows($vari $lista)</em>. Tt makroa voitaisiin kytt
    miss tahansa sivupohjassa. Sit voitaisiin kytt useaan kertaan
    ja moneen eri kytttarkoitukseen. Sieniasioita ksittelevss
    sivupohjassa <code>sieni.vm</code>, <em>#tablerows</em>
    Velocimakroa voitaisiin kytt listaamaan tyypillisen sienen
    osat:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $osat = [&quot;volva&quot;,&quot;stipe&quot;,&quot;annulus&quot;,&quot;gills&quot;,&quot;pileus&quot;] )
#set( $cellbgcol = &quot;#CC00FF&quot; )
&lt;table&gt;
#tablerows( $cellbgcol $osat )
&lt;/table&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kun Velocity luo sivun sivupohjasta <code>sieni.vm</code>, se
    etsii Velocimakron <em>#tablerows</em> sivupohjakirjastosta (joka
    on mritelty <code>velocity.properties</code> tiedostossa) ja
    tuottaa seuraavan tulosteen:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
&lt;table&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;#CC00FF&quot;&gt;volva&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;#CC00FF&quot;&gt;stipe&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;#CC00FF&quot;&gt;annulus&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;#CC00FF&quot;&gt;gills&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td bgcolor=&quot;#CC00FF&quot;&gt;pileus&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <strong>Velocimakron argumentit</strong>
                                                <p>
   Velocimakrot voivat ottaa argumenteiksi mit tahansa seuraavista
   VTL elementeist:
  </p>
                                                <ul>
    <li> 
      Viittaus : mit tahansa '$' merkill alkavaa
    </li>
    <li> 
      Tekstivakio : esimerkiksi "$foo" tai 'hei'
    </li>
    <li> 
      Numerovakio : 1, 2 jne
    </li>
    <li> 
      Numerovli : [ 1..2] tai [$foo .. $bar]
    </li>
    <li> 
      ObjectArray : [ "a", "b", "c"]
    </li>
    <li> 
       boolean arvo true (tosi)
    </li>
    <li> 
       boolean arvo false (eptosi)
    </li>
  </ul>
                                                <p>
     Kun siirrt viittauksia argumentteina Velocimakroille, huomaa,
     ett viittaukset siirretn 'nimen mukaan' ('by name'). Tm
     tarkoittaa sit, ett viittausten arvo 'haetaan' Velocimakrossa
     itsessn. Tmn ominaisuuden avulla voit siirt viittauksia
     jotka ovat metodikutsuja, ja nin ko. metodeja kutsutaan
     Velocimakrossa. Esimerkiksi kun Velocimakroa kutsutaan
     seuraavasti:
   </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
     #macro( kutsu $a )
         $a $a $a
     #end

     #kutsu( $foo.bar() )
   </pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
       tuloksena viittauksen $foo metodia bar() kutsutaan 3 kertaa.
    </p>
                                                <p>
       Ensi katsomalta tm ominaisuus saattaa vaikuttaa yllttvlt,
       mutta kun otat huomioon Velocimakrojen alkuperisen
       tarkoituksen -- usein kytettyjen VTL komentojen leikkaa-liimaa
       kopioimisen vhentminen -- ominaisuus on perusteltu. Sen
       avulla voit esimerkiksi siirt Velocimakroon argumenttina
       tilansa muistavia (stateful) objekteja, kuten objektin joka
       generoi vrej perkkisess jrjestyksess taulukon rivien
       vrien mrittmiseksi.
    </p>
                                                <p>
       Jos sinun tarvitsee kiert tm ominaisuus, voit hakea arvon
       metodista uudeksi viittaukseksi, ja antaa sen argumentiksi:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
     #set( $uusiarvo = $foo.bar() )
     #kutsu( $uusiarvo )
   </pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <strong>Velocimakro ominaisuudet</strong>
                                                <p>
    <code>velocity.properties</code> tiedostossa on useita rivej
    joiden avulla Velocimakrojen toimintaa voidaan muuttaa
    joustavasti. Huomaa ett nm arvot on dokumentoitu mys <a href="http://jakarta.apache.org/velocity/developer-guide.html">Kehittjn
    oppaassa</a>.
    </p>
                                                <p>
    <code>velocimacro.library</code> - Pilkulla eroteltu lista
    Velocimakro sivupohjakirjastoja. Oletuksena Velocity etsii yht
    kirjastoa: <em>VM_global_library.vm</em>. Velocimakro kirjastoja
    etsitn mritellyst sivupohjahakemistosta.
    </p>
                                                <p>
    <code>velocimacro.permissions.allow.inline</code> - Tm
    ominaisuus ptt voidaanko Velocimakroja mritt tavallisissa
    sivupohjissa. Ominaisuus voi saada arvon true (tosi) tai false
    (eptosi). Oletuksena on tosi, jolloin sivusuunnittelijat voivat
    mritt Velocimakroja suoraan omissa sivupohjissaan.
    </p>
                                                <p>
    <code>velocimacro.permissions.allow.inline.to.replace.global</code>

    - Tmn ominaisuuden avulla voidaan mritt voivatko
    sivupohjassa mritellyt Velocimakrot korvata yleisesti
    mritellyt, <code>velocimacro.library</code> ominaisuuden kautta
    ladatut Velocimakrot. Ominaisuus voi saada arvon true tai
    false. Oletuksena <code>false</code>, eptosi, jolloin
    sivupohjassa mritellyt Velocimakrot eivt voi korvata
    sivupohjakirjastoista ladattuja makroja.
    </p>
                                                <p>
    <code>velocimacro.permissions.allow.inline.local.scope</code> -
    Mahdolliset arvot ovat true tai false, oletuksena false. Tm
    ominaisuus ptt ovatko sivupohjassa mritetyt Velocimakrot
    'nkyvi' ainoastaan siin sivupohjassa jossa ne on
    mritelty. Toisin sanoen kun tm ominaisuus on asetettu arvoon
    true (tosi), sivupohja voi mritt inline Velocimakroja jotka
    ovat kytettviss vain sivupohjasta joka ne mritti. Tmn
    ominaisuuden avulla voidaan aikaansaada erikoisia vaikutuksia; jos
    yleisesti mritelty Velocimakro kutsuu toista yleisesti
    mritelty makroa, tmn ominaisuuden avulla sivupohja voi
    mritt oman toteutuksensa jlkimmisest makrosta, jota
    ensimminen makro kutsuu. Sivupohjan paikallista makroa kytetn
    vain kun ensimmist makroa kutsutaan ko. sivupohjasta. Uusi makro
    ei vaikuta muihin sivupohjiin.
    </p>
                                                <p>
    <code>velocimacro.context.localscope</code> - Mahdolliset arvot
    ovat true tai false, oletuksena false. Kun ominaisuuden arvoksi on
    asetettu tosi, Velocimakroissa #set() ohjeella tehdyt muutokset
    ovat 'paikallisia' eivtk vaikuta pysyvsti muuttujien sisltn.
    </p>
                                                <p>
    <code>velocimacro.library.autoreload</code> - Tm ominaisuus
    ohjaa Velocimakrokirjaston automaattista uudelleenlatausta. Kun
    ominaisuus on asetettu arvoon <code>true</code> kutsutun
    Velocimakron koodi tutkitaan mahdollisten muutosten varalta, ja se
    ladataan uudelleen mikli tarpeellista. Nin voit muuttaa ja
    testata Velocimakrokirjastoa ilman ett sinun tarvitsee kynnist
    uudelleen sovellustasi tai sovellusalustaa, aivan kuten voit tehd
    normaalien sivupohjienkin kanssa. Tm asetus toimii vain kun
    resurssilataajien vlimuisti on pois plt (<i>off</i>,
    esim. <code>file.resource.loader.cache = false</code>). Tm
    ominaisuus on tarkoitettu kytettvksi vain sovelluksen
    kehitysvaiheessa, ei tuotantokyttn.
    </p>
                                                <strong>Velocimakro Trivia</strong>
                                                <p>
    Nykyiselln Velocimakrot tulee olla mriteltyin ennen kuin
    niit kytetn sivupohjissa. Tm tarkoittaa sit ett #macro()
    mritystesi tulee sijaita ennen rivej joissa kytt Velocimakroja.
    </p>
                                                <p>
    Tm on trke muistaa jos yritt kytt ohjetta #parse()
    sivupohjaan jossa on inline #macro() ohjeita. Koska #parse()
    suoritetaan ajon aikana, ja parseri ptt ajon aikana onko
    sivupohjassa oleva Velocimakrolta nyttv elementti Velocimakro,
    ei Velocimakrojen #parse():aminen toimi niin kuin
    olettaisi. Ongelma voidaan vltt helposti kyttmll
    <code>velocimacro.library</code> toimintoa jonka avulla Velocity
    lataa Velocimakrosi kynnistyksen yhteydess.
    </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="VTL ohjeiden suojaaminen"><strong>VTL ohjeiden suojaaminen</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    VTL ohjeet voidaan suojata kenoviivalla ("\") samalla tavalla kuin
    VTL viittauksetkin.
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
## #include( &quot;a.txt&quot; ) tulostuu &lt;tiedoston a.txt sislt&gt;
#include( &quot;a.txt&quot; )

## \#include( &quot;a.txt&quot; ) tulostuu \#include( &quot;a.txt&quot; )
\#include( &quot;a.txt&quot; )

## \\#include ( &quot;a.txt&quot; ) tulostuu \&lt;tiedoston a.txt sislt&gt;
\\#include ( &quot;a.txt&quot; )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Erityst tarkkaavaisuutta tarvitaan tapauksissa joissa suojataan VTL
  ohjeita jotka sisltvt useita skriptielementtej samassa ohjeessa
  (kuten if-else-end lause). Seuraavassa on tyypillinen VTL if-lause:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#if( $jazz )
    Vyacheslav Ganelin
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Jos <em>$jazz</em> on tosi (true), tuloste on
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Vyacheslav Ganelin
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Jos <em>$jazz</em> on eptosi (false), tulostetta ei
  tule. Skriptielementtien suojaaminen muuttaa tulostetta. Katso
  seuraavaa esimerkki:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
\#if( $jazz )
    Vyacheslav Ganelin
\#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Riippumatta siit onko <em>$jazz</em> tosi vai eptosi, tuloste on
  aina:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
 #if($ jazz )
     Vyacheslav Ganelin
 #end
 </pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Itse asiassa koska kaikki skriptielementit on suojattu,
  <em>$jazz</em> muuttujan totuusarvoa ei edes tutkita. Oletetaan ett
  kenoviiva edelt skriptielementtej jotka on suojattu:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
\\#if( $jazz )
   Vyacheslav Ganelin
\\#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Mikli <em>$jazz</em> on tss tapauksessa tosi, tuloste on:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
\ Vyacheslav Ganelin
\
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Tmn ymmrtmiseksi huomaa, ett <code>#if( arg )</code> rivill
  olevaa rivinvaihtoa (return) ei kopioida tulosteeseen. Tmn vuoksi
  <code>#if()</code> lauseen runko ('Vyacheslav Ganelin') on '\\'
  merkinnst saadun ensimmisen '\' merkin kanssa samalla
  rivill. Jlkimminen '\' merkki on toisella rivill kuin teksti,
  koska tekstin lopussa on rivinvaihto ja jlkimminen '\\'
  merkinnst saatu '\' merkki on ennen <code>#end</code> ohjetta,
  joten merkki kuuluu edelleen <code>#if()</code> lauseen runkoon.
  </p>
                                                <p>
  Jos <em>$jazz</em> on eptosi, ei tulostetta tule. Huomaa ett
  ongelmia tulee mikli skriptielementtej ei ole suojattu oikein.
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
\\\#if( $jazz )
    Vyacheslave Ganelin
\\#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
  Esimerkiss <em>#if</em> on suojattu, mutta <em>#end</em> elementti
  on edelleen kytss. Liian monta lopetuselementti sivupohjassa
  aiheuttaa virheen sivua luotaessa.
  </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="VTL: Muotoilu"><strong>VTL: Muotoilu</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Vaikka tss ohjeessa oleva VTL on usein muotoiltu rivivaihdoin ja
    vlilynnein, alla oleva VTL
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $imperial = [&quot;Munetaka&quot;,&quot;Koreyasu&quot;,&quot;Hisakira&quot;,&quot;Morikune&quot;] )
#foreach( $shogun in $imperial )
    $shogun
#end
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    on yht toimiva kuin seuraava kodinptk jonka Geir Magnusson
    Jr. lhetti Velocityn kyttjien postituslistalle:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Send me #set($foo = [&quot;$10 and &quot;,&quot;a cake&quot;])#foreach($a in $foo)$a #end please.
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Velocity sy ylimriset vlilynnit. Edellinen koodinptk
    voitaisiin kirjoittaa seuraavasti:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Send me
#set( $foo = [&quot;$10 and &quot;,&quot;a cake&quot;] )
#foreach( $a in $foo )
$a
#end
please.
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    tai
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Send me
#set($foo       = [&quot;$10 and &quot;,&quot;a cake&quot;])
                 #foreach           ($a in $foo )$a
         #end please.
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Kussakin tapauksessa tulos on sama.
    </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Muita ominaisuuksia ja sekalaista"><strong>Muita ominaisuuksia ja sekalaista</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                        <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Matematiikka"><strong>Matematiikka</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Velocitylla on muutamia sisnrakennettuja matemaattisia
    funktioita joita voidaan kytt sivupohjissa <em>#set</em> ohjeen
    kanssa. Seuraavat yhtlt ovat esimerkkej yhteen-, vhennys-,
    kerto- sek jakolaskuista.
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $foo = $bar + 3 )
#set( $foo = $bar - 4 )
#set( $foo = $bar * 6 )
#set( $foo = $bar / 2 )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Jako-operaation tapauksessa tulos on kokonaisluku. Jakojnns
    saadaan kyttn jnnsoperandilla (<em>%</em>).
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $foo = $bar % 5 )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Matemaattisia funktioita kytettess Velocityss vain
    kokonaisluvut (...-2, -1, 0, 1, 2...) ovat sallittuja;
    ei-kokonaislukuja kytettess asia kirjataan lokiin ja tulokseksi
    palautetaan tyhj arvo (null).
  </p>
                                                <p>
    Velocityll on sisnrakennettu keino nollalla jakamisen
    ksittelemiseen. Seuraavassa esimerkiss:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $foo = 5 )
#set( $bar = $foo - 5 )
#set( $uhoh = $foo / $bar )
$uhoh
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Viittaukseen <em>$uhoh</em> asetetaan tulos operaatiosta viisi
    jaettuna nollalla. Kun Velocity nytt tmn sivupohjan, tuloste
    on:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$uhoh
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Suunnittelijoiden on otettava huomioon mys, ett <em>#set</em>
    tuottaa merkkijonoja, jotka on muunnettava kokonaisluvuiksi jotta
    niit voidaan kytt vaihteluvli mritettess (range
    operator). Seuraavassa esimerkki tllaisesta muunnoksesta:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set($a = &quot;7&quot;)
#set($b = $int.valueOf($a) + 10)
$b
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tuloksena on <em>17</em>.
  </p>
                            </blockquote>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Vaihteluvli (Range Operator)"><strong>Vaihteluvli (Range Operator)</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Vaihteluvli voidaan kytt <em>#set</em> ja <em>#foreach</em>
    lauseiden yhteydess. Vaihteluvli tuottaa kokonaislukuja
    sisltvi oliotaulukoita seuraavalla tavalla:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
[n..m]
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Sek <em>n</em> ett <em>m</em> pit olla tai niiden tulee
    tuottaa kokonaislukuja. Mikli <em>m</em> on pienempi kuin
    <em>n</em> lasketaan vaihteluvlin luvut alaspin. Seuraavassa
    esimerkkej vaihteluvlin kytst:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Ensimminen esimerkki:
#foreach( $foo in [1..5] )
$foo
#end

Toinen esimerkki:
#foreach( $bar in [2..-2] )
$bar
#end

Kolmas esimerkki:
#set( $arr = [0..1] )
#foreach( $i in $arr )
$i
#end

Neljs esimerkki:
[1..3]
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tuottaa seuraavan tulosteen:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Ensimminen esimerkki:
1 2 3 4 5

Toinen esimerkki:
2 1 0 -1 -2

Kolmas esimerkki:
0 1

Neljs esimerkki:
[1..3]
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Huomaa ett vaihteluvlioperaattori tuottaa taulukon vain kun sit
    kytetn <em>#set</em> tai <em>#foreach</em> ohjeiden kanssa,
    kuten neljnnest esimerkist ky selville.
  </p>
                                                <p>
    Vaihteluvlioperaattori on erityisen kyttkelpoinen kun halutaan
    tehd verkkosivun taulukko standardikokoiseksi, mutta joissain
    tapauksissa taulukon tyttmiseksi ei ole riittvsti dataa.
  </p>
                            </blockquote>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Edistyneet kysymykset: Suojaaminen ja !"><strong>Edistyneet kysymykset: Suojaaminen ja !</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Kun viittaus hiljennetn <em>!</em> merkill ja <em>!</em> merkki
    edelt suojausmerkki <em>\</em> ksitelln viittaus erityisell
    tavalla. Huomaa erot normaalin suojauksen ja tilanteen jossa
    <em>\</em> edelt <em>!</em> merkki, vlill.
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set( $foo = &quot;bar&quot; )
$\!foo
$\!{foo}
$\\!foo
$\\\!foo
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
   Tulosteena on:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
$!foo
$!{foo}
$\!foo
$\\!foo
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
   Vertaa tt normaaliin suojaukseen, jossa <em>\</em> on <em>$</em>
   merkin edell:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
\$foo
\$!foo
\$!{foo}
\\$!{foo}
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    Tulosteena on:
  </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
\$foo
\$!foo
\$!{foo}
\bar
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                            </blockquote>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Yleist Velocimakroista"><strong>Yleist Velocimakroista</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
Tm osio on Velocimakroaiheinen mini-FAQ. Osio muuttuu ajan myt,
joten uutta tietoa hakevien kannattanee palata sivulle aika ajoin.
</p>
                                                <p>
Huom! : Tss osiossa 'Velocimakro':ihin viitataan usein lyhenteell
'VM'.
</p>
                                                <strong>Voinko kytt ohjetta tai toista VM:a argumenttina
VM:oon?</strong>
                                                <p>
Esimerkki : <code>#center( #bold("hello") )</code>
</p>
                                                <p>
Et. Ohje ei ole sallittu argumentti ohjeelle, ja VM on
kytnnllisesti katsoen ohje.
</p>
                                                <p>
<i>Kuitenkin...</i>, voit kiert rajoituksen. Yksinkertainen ratkaisu
on kytt hyvksi sit ett lainausmerkeiss (") oleva teksti
tulkitaan. Tm ansiosta voit tehd seuraavasti:
</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set($stuff = &quot;#bold('hello')&quot; )
#center( $stuff )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
Voit mys sst rivin...
</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#center( &quot;#bold( 'hello' )&quot; )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
Huomaa ett jlkimmisess esimerkiss parametri ksitelln VM:n
<i>sisll</i>, ei kutsun tasolla. Toisin sanoen VM:lle annettu
parametri siirretn kokonaisuudessaan ja ksitelln VM:ssa johon se
siirrettiin. Tmn ansiosta voit tehd esimerkiksi seuraavaa:
</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>

#macro( inner $foo )
  inner : $foo
#end

#macro( outer $foo )
   #set($bar = &quot;outerlala&quot;)
   outer : $foo
#end

#set($bar = 'calltimelala')
#outer( &quot;#inner($bar)&quot; )

</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
Tulosteeksi tulee
</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
Outer : inner : outerlala
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
koska parametrin "#inner($bar)" tulkitseminen tapahtuu lauseen
#outer() sisll, kytetn muuttujan $bar arvoa joka asetettiin
#outer VM:ssa.
</p>
                                                <p>
Tm on tarkoituksellinen ja tarkkaan vaalittu ominaisuus - parametrit
siirretn 'nimen mukaan' ('by name') VM:oon, jotta voit siirt
VM:oon tilansa muistavia (stateful) viittauksia kuten
</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#macro( foo $vari )
  &lt;tr bgcolor=$vari&gt;&lt;td&gt;Hei&lt;/td&gt;&lt;/tr&gt;
  &lt;tr bgcolor=$vari&gt;&lt;td&gt;Siell&lt;/td&gt;&lt;/tr&gt;
#end

#foo( $bar.rivinVari() )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
jossa rivinVari() metodia kutsutaan toistuvasti, ei vain kerran. Sen
vlttmiseksi kutsu metodia VM:n ulkopuolelta ja siirr arvo VM:oon.
</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
#set($vari = $bar.rivinVari())
#foo( $vari )
</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <strong>Voinko rekisterid Velocimakroja #parse() :n kautta?
</strong>
                                                <p>
    Nykyiselln Velocimakrot tulee olla mriteltyin ennen
    ensimmist kytt. Tm tarkoittaa sit ett #macro()
    mritystesi tulisi tulla ennen kuin kytt Velocimakroja.
    </p>
                                                <p>
    Tm on trke muistaa jos yritt kytt ohjetta #parse()
    sivupohjaan jossa on inline #macro() ohjeita. Koska #parse()
    suoritetaan ajon aikana, ja parseri ptt ajon aikana onko
    sivupohjassa oleva Velocimakrolta nyttv elementti Velocimakro,
    ei Velocimakrojen #parse():aminen toimi niin kuin
    olettaisi. Ongelma voidaan vltt helposti kyttmll
    <code>velocimacro.library</code> toimintoa jonka avulla Velocity
    lataa Velocimakrosi kynnistyksen yhteydess.
    </p>
                                                <strong>Mit tarkoittaa Velocimakrojen automaattinen
uudelleenlataus?</strong>
                                                <p>
   On olemassa asetus joka on tarkoitettu kytettvksi jrjestelmn
   <i>kehityksen</i> aikana, ei kytss olevassa jrjestelmss :
  </p>
                                                <p>
  <code>velocimacro.library.autoreload</code>
  </p>
                                                <p>
   joka on oletuksena pois kytst (false). Kun ominaisuus on
   asetettu kyttn (true) <em>yhdess</em> asetuksen
   </p>
                                                <p>
   <code>&lt;type&gt;.resource.loader.cache = false</code>
   </p>
                                                <p>
    kanssa (jossa &lt;type&gt; on resurssilataajan nimi jota kytt,
    kuten 'file'), silloin Velocity lataa automaattisesti
    Velocitymakroihin tekemsi muutokset silloin kun teet niit, joten
    sinun ei tarvitse kynnist uudelleen sovellusalustaa (tai
    ohjelmaa) tai turvautua johonkin muuhun kikkaan saadaksesi
    muuttuneet Velocitymakrosi kyttn.
    </p>
                                                <p>
    Yksinkertainen konfiguraatio saattaisi nytt seuraavalta:
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
    file.resource.loader.path = templates
    file.resource.loader.cache = false
    velocimacro.library.autoreload = true
    </pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
    l kyt nit asetuksia tuotantokytss.
    </p>
                            </blockquote>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Merkkijonojen yhdistminen"><strong>Merkkijonojen yhdistminen</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Yleinen kehittjien kysym kysymys on <i>Kuinka yhdistn
    merkkijonoja? Onko olemassa Javan '+' operaattoria vastaavaa
    toimintoa?</i>.
   </p>
                                                <p>
    Viittausten liittmiseksi yhteen VTL:ssa, sinun tarvitsee vain
    'laittaa ne yhteen'. Konteksti jossa yhdistt viittaukset
    vaikuttaa tuloksiin, joten esimerkit ovat paikallaan.
   </p>
                                                <p>
    Normaalissa tapauksessa (jolloin sekoitat muuttujat sivupohjan
    muuhun sisltn) :
   </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
       #set( $koko = &quot;Big&quot; )
       #set( $nimi = &quot;Ben&quot; )

      Kello on $iso$nimi.
   </pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     tulosteena on 'Kello on BigBen'. Hieman mielenkiintoisemmassa
     tapauksessa, kuten silloin kun haluat liitt merkkijonot
     siirrettvksi parametrina metodille, tai asettaaksesi uuden
     viittauksen, tee seuraavasti:
   </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
      #set( $koko = &quot;Big&quot; )
      #set( $nimi = &quot;Ben&quot; )

      #set($kello = &quot;$koko$nimi&quot; )

      Kello on $kello.
    </pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
     Josta tulee sama tuloste. Viimeisen esimerkkin, kun haluat
     sekoittaa 'staattisia' merkkijonoja viittauksiin, saatat joutua
     kyttmn 'muodollista viittausten merkint' :
    </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>
      #set( $koko = &quot;Big&quot; )
      #set( $nimi = &quot;Ben&quot; )

      #set($kello = &quot;${koko}Tall$nimi&quot; )

      Kello on $kello.
    </pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
      Nyt tuloste on 'Kello on BigTallBen'. Muodollista viittausten
      merkint kytetn, jotta parseri tietisi ett tarkoitat
      viittauksellasi muuttujaa '$size' eik '$sizeTall', jota se
      kyttisi mikli et olisi kyttnyt '{}' merkkej.
    </p>
                            </blockquote>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica,sanserif">
          <a name="Palaute"><strong>Palaute</strong></a>
        </font>
      </td></tr>
      <tr><td>
        <blockquote>
                                    <p>
    Mikli lydt tst ohjeesta virheit tai haluat antaa ohjetta
    koskevaa palautetta, ole hyv ja lhet shkpostia <a href="mailto:velocity-user@jakarta.apache.org">Velocity
    kyttjlistalle</a>.  Kiitos!
  </p>
                            </blockquote>
        </p>
      </td></tr>
      <tr><td><br/></td></tr>
    </table>
                                        </td>
                </tr>

                <!-- FOOTER -->
                <tr><td colspan="2">
                    <hr noshade="" size="1"/>
                </td></tr>
                <tr><td colspan="2">
                    <div align="center"><font color="#525D76" size="-1"><em>
                    Copyright &#169; 1999-2004, The Apache Software Foundation
                    </em></font></div>
                </td></tr>
            </table>
        </body>
    </html>
<!-- end the processing -->