Should we change the following lines in the LoopTask? Currently, the string is split based on a single delimiter. Since String.Split() supports a character array, we can remove the char array [0] indexer and have it split on any character in the "delim" property. I can fix this and check it in, if noone objects:

                   case ItemTypes.String: {
                       if(Delimiter != null && Delimiter.Length > 0) {
                           string[] items = _source.Split(Delimiter.ToCharArray()[0]);
                           foreach(string s in items)
                               DoWork(s);
                       }
                       else
                           throw new BuildException("Invalid delim: " + _delim, 
Location);
                       break;
                   }

becomes:

                   case ItemTypes.String: {
                       if(Delimiter != null && Delimiter.Length > 0) {
                           string[] items = _source.Split(Delimiter.ToCharArray());
                           foreach(string s in items)
                               DoWork(s);
                       }
                       else
                           throw new BuildException("Invalid delim: " + _delim, 
Location);
                       break;
                   }

It would also be nice if we could support delim and multiple properties for the foreach item="line" task to parse a file with (potentially) multiple items per line. Something along the lines of:

<foreach item="Line" in="C:\foo.txt" delim="," property="x" property="y">
 <echo message="copying ${x} to ${y}"/>
 ...
</foreach>

How does this sound?




------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to