help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing a list by element (ie SRC= foo.c bar.c etc.c)


From: Young, Ed
Subject: Accessing a list by element (ie SRC= foo.c bar.c etc.c)
Date: Mon, 14 Apr 2003 14:45:07 -0600


Dear Make Experts,

I need to be able to access each element of a list and operate upon them differently.

It is similar to using the foreach construct to run commands over a list of files but I want to treat certain ones (the first and last) in the list differently. I therefore want to be able to access the elements of the list.

essentially this is what I want to do:

SRC = "" bar.c shoobopa.c bopalulu.c

for the first elment in the list do something special
for the last  element in the list do something else special

for everything in between do some other command.

Or like this:
somecommand(SRC[0]);
someothercommand(SRC[n]);

for(i=1; i<n; i++)
         dotherest(SRC[i]);


The closest construct that I've found is the foreach command, but I need to be able to access elements of the list SRC.

I've looked in the tutorial and haven't found anything that allows decomposition of a list.

Can you point me in the right dirction?

Thank you,

Ed
Ed Young
Echostar Software Engineering
303-706-5421
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]