4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #pragma D option quiet
36 @tour["Ghent", i++, j] = sum(5 - j);
39 @tour["Berlin", i++, j] = sum(5 - j);
42 @tour["London", i++, j] = sum(5 - j);
43 @tour["Dublin", i++, j] = sum(5 - j);
46 @tour["Shanghai", i++, j] = sum(5 - j);
49 @tour["Zurich", i++, j] = sum(5 - j);
52 @tour["Regina", i++, j] = sum(5 - j);
53 @tour["Winnipeg", i++, j] = sum(5 - j);
54 @tour["Edmonton", i++, j] = sum(5 - j);
55 @tour["Calgary", i++, j] = sum(5 - j);
56 @tour["Vancouver", i++, j] = sum(5 - j);
57 @tour["Victoria", i++, j] = sum(5 - j);
60 @tour["Prague", i++, j] = sum(5 - j);
61 @tour["London", i++, j] = sum(5 - j);
64 @tour["Brisbane", i++, j] = sum(5 - j);
65 @tour["Sydney", i++, j] = sum(5 - j);
66 @tour["Melbourne", i++, j] = sum(5 - j);
69 setopt("aggsortkey", "false");
70 setopt("aggsortkeypos", "0");
71 @tour["Amsterdam", i++, j] = sum(5 - j);
73 printf("By value:\n");
74 printa("%20s %8d %8d %8@d\n", @tour);
77 printf("\nBy key, position 0:\n");
78 printa("%20s %8d %8d %8@d\n", @tour);
80 setopt("aggsortkeypos", "1");
81 printf("\nBy key, position 1:\n");
82 printa("%20s %8d %8d %8@d\n", @tour);
84 setopt("aggsortkeypos", "2");
85 printf("\nBy key, position 2:\n");
86 printa("%20s %8d %8d %8@d\n", @tour);
88 setopt("aggsortkey", "false");
89 setopt("aggsortkeypos", "0");
92 printf("\nReversed by value:\n");
93 printa("%20s %8d %8d %8@d\n", @tour);
96 printf("\nReversed by key, position 0:\n");
97 printa("%20s %8d %8d %8@d\n", @tour);
99 setopt("aggsortkeypos", "1");
100 printf("\nReversed by key, position 1:\n");
101 printa("%20s %8d %8d %8@d\n", @tour);
103 setopt("aggsortkeypos", "2");
104 printf("\nReversed by key, position 2:\n");
105 printa("%20s %8d %8d %8@d\n", @tour);