This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chlist.cl
52 lines (45 loc) · 1.7 KB
/
chlist.cl
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
43
44
45
46
47
48
49
50
51
52
# CHLIST 21FEB94 KMM
# CHLIST produces list of images of form id###
# where id is an alphanumeric base id and ### is an integers:
# starting at first_image, increments of delta, number images in final list
# e.g. deltalist dat001 3 delta=3 produces
# dat001
# dat004
# dat007
# CHLIST: 09SEP93 KMM incorporates id_color indicator to all additional
# choices for color naming conventions
procedure chlist (first_image,number)
string first_image {prompt="First image in sequentially numbered images"}
int number {prompt="Number of images in output list"}
int delta {4,prompt=""}
string id_color {"end",
prompt="Location of color indicator? (end|predot|seq)",
enum="end|predot|sequence" }
# "predot == FIRE mode: root || [jhkl] || .number
# " end == WILDFIRE mode: root || (.) number || [jhkl]
# " sequence mode: root || number; number incerments between colors
begin
int nim,i,max,off
string first,name,name0,color,snim
file tmp1
first = first_image
max = number
# get rid of ".imh" extension
i = strlen(first)
if (substr(first,i-3,i) == ".imh")
first = substr(first,1,i-4)
i = strlen(first)
if (id_color == "end") {
color = substr(first,i,i)
first = substr(first,1,(i-1)) # drop [jhkl]
for (nim=1; nim <= max; nim += 1) {
name = first + (nim-1)*delta
print (name//color//".imh")
}
} else {
for (nim=1; nim <= max; nim += 1) {
name = first + (nim-1)*delta
print (name//".imh")
}
}
end