[Cook] Problem extracting string from list with 'word'
Larry Wagner
wagner at weru.ksu.edu
Fri Dec 5 08:39:08 EST 2003
I have the following:
mod_files = "mname1.mod mname2.mod mname3.mod";
mod_src = "dir1/mname1.f95 dir3/mname2.f95 dir2/mname3.f95"
Based upon the filename selected in the "mod_files" list,
I want to extract the corresponding file/path from the "mod_src" list.
I've tried the following two approaches, but get a cook error:
x = [matches "mname2.mod" [mod_files];
src_file = [word [x] [mod_src];
or
src_file = [word [matches "mname2.mod" [mod_files]] [mod_src];
The error I get is:
word: argument 1: must be a positive decimal number
x evaluates to 2 as expected in the first statement.
How do I get cook to do what I want in this situation?
LEW
[matches "mname2.mod" [mod_files]
Larry Wagner, Agricultural Engineer | E-mail: wagner at weru.ksu.edu
USDA-ARS Wind Erosion Research Unit | phone: (785) 537-5544
1515 College Ave. | fax: (785) 537-5507
Manhattan, KS 66502 | URL: http://www.weru.ksu.edu
More information about the Cook-users
mailing list