summaryrefslogtreecommitdiff
path: root/web/clip/vax_vms/ex01_b.asc
blob: af96cdf4aa0ee7d62d9a05158ed560c83175aaed (plain)
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



                             Example 01: Testcode





This section contains some test code that can be inserted to debug the
palindrome filter program.


B.1.  Print the contents of IN_LINE and LETTERS

Correct reading of the input is crucial. For debugging purposes we may want to
inspect the contents of *IN_LINE* and *LETTERS*. We need a local counter

   (*******    Palindrome variables              #quick  *******)
       T :         INTEGER;

We want the debugging information te be clearly flagged as such.

   (*****************  Palindrome (test)  ******************)
   (** Check contents of IN_LINE and LETTERS.             **)
   WRITELN;
   WRITELN ('============  DEBUGGING INFORMATION  ===============');
   WRITELN ('Contents of buffer IN_LINE: ');
   WRITE   ('>>>>');
   WITH IN_LINE DO
   FOR T := 1 TO LENGTH DO WRITE (OUTPUT, CHARS[T]);
   WRITE   ('<<<<');
   WRITELN;
   WRITELN ('Contents of buffer LETTERS:  ');
   WRITE   ('>>>>');
   WITH LETTERS DO
   FOR T := 1 TO LENGTH DO WRITE (OUTPUT, CHARS[T]);
   WRITE   ('<<<<');
   WRITELN;
   WRITELN ('==========  END OF DEBUGGING INFORMATION  ==========');
   WRITELN;
   (*************  End of Palindrome (test)  ***************)