~ubuntu-branches/ubuntu/trusty/bc/trusty

« back to all changes in this revision

Viewing changes to Test/arrayp.b

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2002-04-13 11:33:49 UTC
  • Revision ID: james.westby@ubuntu.com-20020413113349-hl2r1t730b91ov68
Tags: upstream-1.06
ImportĀ upstreamĀ versionĀ 1.06

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"This tests arrays!
 
2
"
 
3
define p(a[],x,y) {
 
4
  auto i;
 
5
  for (i=x; i<y; i++) a[i];
 
6
}
 
7
 
 
8
define m(a[],x,y) {
 
9
  auto i;
 
10
  for (i=x; i<y; i++) a[i] = i;
 
11
}
 
12
 
 
13
define m1(*a[],x,y) {
 
14
  auto i;
 
15
  print "m1\n"
 
16
  for (i=x; i<y; i++) a[i] = i;
 
17
}
 
18
 
 
19
for (i=0; i<10; i++) a[i] = i;
 
20
j = p(a[],0,10);
 
21
 
 
22
j = m(b[],0,10);
 
23
j = p(b[],0,10);
 
24
 
 
25
print "---\n";
 
26
j = m1(b[],0,10);
 
27
j = p(b[],0,10);
 
28
 
 
29
quit
 
30