File: hi03.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 (25 lines) | stat: -rw-r--r-- 779 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
HI03: This example shows how FunnelWeb's macro facility can be used to
      fudge conditionals. This method is different to HI02.

@O@<hi03.out@>==@{
@<Sloth incrementing loop@>
@}

@A@<Debug Macro@>

The following macro determines whether debug code will be included in the
program. All debug code is wrapped by a call to this macro and so
we can turn all the debug code on or off here by defining this macro to be
either empty or its parameter.

@$@#D@(@1@)@M==@{@1@}     @! Turns the debug code ON.
@! Use this definition to turn the debug code OFF: @$@#D@(@1@)==@{@}



@$@<Sloth incrementing loop@>==@{@-
while sloth<walrus loop
   @#D@(assert(sloth<walrus,"AWK! sloth>=walrus!!!!!!!");
        assert(timer<timermax,"AWK! timer>=timermax!!!");@)
   inc(sloth);
end loop@}