Debian Codegraph @

tests/ex07.fw

raw
1 EX07: This example demonstrates the use of macro parameters.
2
3 @O@<ex07.out@>==@{@<While user code@>@+@}
4
5 @$@<While loop@>@(@3@)@M==@{@-
6 @1
7 while (@2)
8 {
9 @3
10 }
11 @}
12
13 @$@<While user code@>==@{
14
15 @! First form of actual parameters without whitespace and double quotes.
16 @<While loop@>@(x=1;@,x<=10@,printf("X=%u\n",x);@)
17
18 @! Second form of actual parameters. The double quotes allow non-active
19 @! whitespace that helps to lay out the actual parameters neatly.
20 @! This call is functionally identical to the one above.
21 @<While loop@>@(
22 @"x:=1;@" @,
23 @"x<=10@" @,
24 @"printf("X=%u\n",x);@" @)
25
26 @! The two forms can be mixed in a single call.
27 @<While loop@>@(x=1;@,x<=10@,
28 @"printf("X=%u\n",x);@" @)
29
30 @}