File: ex07.fw

package info (click to toggle)
funnelweb 3.2-4.2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,744 kB
  • sloc: ansic: 9,156; makefile: 17
file content (30 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (7)
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
EX07: This example demonstrates the use of macro parameters.

@O@<ex07.out@>==@{@<While user code@>@+@}

@$@<While loop@>@(@3@)@M==@{@-
@1
while (@2)
  {
   @3
  }
@}

@$@<While user code@>==@{

@! First form of actual parameters without whitespace and double quotes.
@<While loop@>@(x=1;@,x<=10@,printf("X=%u\n",x);@)

@! Second form of actual parameters. The double quotes allow non-active
@! whitespace that helps to lay out the actual parameters neatly.
@! This call is functionally identical to the one above.
@<While loop@>@(
   @"x:=1;@" @,
   @"x<=10@" @,
   @"printf("X=%u\n",x);@" @)

@! The two forms can be mixed in a single call.
@<While loop@>@(x=1;@,x<=10@,
              @"printf("X=%u\n",x);@" @)

@}