DMDX Help.
Indexed Branch Keyword
<IndexedBranch
designator>
<ib
designator>
variant:
Indexed Call Keyword
<IndexedCall
designator>
<ic
designator>
counter designators:
counter.name.
c.name.
counterN
cN
N
Performs a branch based to an item
number based on the value of counter
.name. or counter number
N. See <Branch> and <SetCounter>. To perform a branch to an item number earlier in the item file
the specified counter's value will have to be negative if you don't
want to wait for DMDX to parse all the items to the end of the file and see it's
not there and then go and use it's buffered item
locations.
There's actually a couple of examples that use
<ib> in the
Dynamic Item Content help and
for a discussion on the uses of indexed branching see the
Indexed Branching section in the built in
introduction.
A somewhat simpler example might be
the case of displaying the subjects error rate from the
<SkipDisplay>
documentation. Because DMDX prior to 2.6.02 couldn't
actually display a counter as a stimulus one to had to have an item for each possible
error rate (now of course
<sprintf>
is a far superior solution) and because that example was created before
<ib> existed it had tests in every error rate
display item, with an indexed branch we can just load a counter up with the
error rate and branch on it:
f60 <clfb>
0 "ErrorRate Feedback Example" <bu 1000>;
~111
<set c.index. = errorrate> <ib c.index.>;
0 "Error Rate 0%" / <return>;
1 "Error Rate 1%" / <return>;
2 "Error Rate 2%" / <return>;
3 "Error Rate
3%" / <return>;
4 "Error Rate 4%" / <return>;
5 "Error Rate 5%" /
<return>;
6 "Error Rate 6%" / <return>;
7 "Error Rate 7%" / <return>;
8
"Error Rate 8%" / <return>;
9 "Error Rate 9%" / <return>;
10 "Error Rate
10%" / <return>;
11 "Error Rate 11%" / <return>;
12 "Error Rate 12%" /
<return>;
13 "Error Rate 13%" / <return>;
14 "Error Rate 14%" / <return>;
15 "Error Rate 15%" / <return>;
16 "Error Rate 16%" / <return>;
17 "Error
Rate 17%" / <return>;
18 "Error Rate 18%" / <return>;
19 "Error Rate 19%"
/ <return>;
20 "Error Rate 20%" / <return>;
21 "Error Rate 21%" /
<return>;
22 "Error Rate 22%" / <return>;
23 "Error Rate 23%" / <return>;
24 "Error Rate 24%" / <return>;
25 "Error Rate 25%" / <return>;
26 "Error
Rate 26%" / <return>;
27 "Error Rate 27%" / <return>;
28 "Error Rate 28%"
/ <return>;
29 "Error Rate 29%" / <return>;
30 "Error Rate 30%" /
<return>;
31 "Error Rate 31%" / <return>;
32 "Error Rate 32%" / <return>;
33 "Error Rate 33%" / <return>;
34 "Error Rate 34%" / <return>;
35 "Error
Rate 35%" / <return>;
36 "Error Rate 36%" / <return>;
37 "Error Rate 37%"
/ <return>;
38 "Error Rate 38%" / <return>;
39 "Error Rate 39%" /
<return>;
40 "Error Rate 40%" / <return>;
41 "Error Rate 41%" / <return>;
42 "Error Rate 42%" / <return>;
43 "Error Rate 43%" / <return>;
44 "Error
Rate 44%" / <return>;
45 "Error Rate 45%" / <return>;
46 "Error Rate 46%"
/ <return>;
47 "Error Rate 47%" / <return>;
48 "Error Rate 48%" /
<return>;
49 "Error Rate 49%" / <return>;
50 "Error Rate 50%" / <return>;
51 "Error Rate 51%" / <return>;
52 "Error Rate 52%" / <return>;
53 "Error
Rate 53%" / <return>;
54 "Error Rate 54%" / <return>;
55 "Error Rate 55%"
/ <return>;
56 "Error Rate 56%" / <return>;
57 "Error Rate 57%" /
<return>;
58 "Error Rate 58%" / <return>;
59 "Error Rate 59%" / <return>;
60 "Error Rate 60%" / <return>;
61 "Error Rate 61%" / <return>;
62 "Error
Rate 62%" / <return>;
63 "Error Rate 63%" / <return>;
64 "Error Rate 64%"
/ <return>;
65 "Error Rate 65%" / <return>;
66 "Error Rate 66%" /
<return>;
67 "Error Rate 67%" / <return>;
68 "Error Rate 68%" / <return>;
69 "Error Rate 69%" / <return>;
70 "Error Rate 70%" / <return>;
71 "Error
Rate 71%" / <return>;
72 "Error Rate 72%" / <return>;
73 "Error Rate 73%"
/ <return>;
74 "Error Rate 74%" / <return>;
75 "Error Rate 75%" /
<return>;
76 "Error Rate 76%" / <return>;
77 "Error Rate 77%" / <return>;
78 "Error Rate 78%" / <return>;
79 "Error Rate 79%" / <return>;
80 "Error
Rate 80%" / <return>;
81 "Error Rate 81%" / <return>;
82 "Error Rate 82%"
/ <return>;
83 "Error Rate 83%" / <return>;
84 "Error Rate 84%" /
<return>;
85 "Error Rate 85%" / <return>;
86 "Error Rate 86%" / <return>;
87 "Error Rate 87%" / <return>;
88 "Error Rate 88%" / <return>;
89 "Error
Rate 89%" / <return>;
90 "Error Rate 90%" / <return>;
91 "Error Rate 91%"
/ <return>;
92 "Error Rate 92%" / <return>;
93 "Error Rate 93%" /
<return>;
94 "Error Rate 94%" / <return>;
95 "Error Rate 95%" / <return>;
96 "Error Rate 96%" / <return>;
97 "Error Rate 97%" / <return>;
98 "Error
Rate 98%" / <return>;
99 "Error Rate 99%" / <return>;
100 "Error Rate 100%" / <return>;
+1000 * "target";
+1000 * "target";
~2000
<call -111>;
DMDX Index.