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
|
alias getaccess {
var %a = 1
set %b $lines(protect\access\ $+ $1 $+ .txt)
if (!$read(protect\access\ $+ $1 $+ .txt, w, * $+ $2 $+ *)) {
while (%a <= %b) {
set %c $read(protect\access\ $+ $1 $+ .txt, %a)
if ($gettok(%c, 2, 32) == $address($2,2)) {
set %readn $readn
return $gettok(%c,3,32)
inc %a
}
else {
inc %a
}
}
}
else {
while (%a <= %b) {
set %c $read(protect\access\ $+ $1 $+ .txt, %a)
if ($gettok(%c, 1, 32) == $2) {
set %readn $readn
return $gettok(%c,3,32)
inc %a
}
else {
inc %a
}
}
}
} |