Getting Started with TRANSACT (32247-90007)

126 Chapter8
Special Topics
Arrays
Figure 8-9. One Dimensional Array (Continued)
This example was purposely left as close as possible to the bubble sort example. The
differences between the two examples are highlighted.
28 until (dun) = (yes);
29 let (no-of-parts) = (count);
30 let (parts-this-pass) = (no-of-parts);
31 while (parts-this-pass) > 0
32 perform 100-bubble-sort;
33 <<deleted 33-39>>
40 let (count) = (no-of-parts);
41 while (count) > 0
42 do
43 display(table) each-part((count)),head="part-number";
44 <<deleted>>
45 let (count) = (count) - 1;
46 doend;
47 end;
48
49 100-bubble-sort:
50
51 <<deleted>>
52 let (count)= 1;
53 while (count) < (parts-this-pass)
54 do
55 <<moved to 65.1>>
56 <<deleted 56-57>>
58 if (from-part((count))) < (to-part((count)))
59 then
60 do
61 move (temp-part) = (to-part((count)));
62 move (to-part((count))) = (from-part((count)));
63 move (from-part((count))) = (temp-part);
64 doend;
65 <<deleted>>
65.1 let (count) = (count) + 1;
66 doend;
67 let (parts-this-pass) = (parts-this-pass) - 1;
68 return;