[Swift-user] Question about arrays of struct data

Lorenzo Pesce lpesce at uchicago.edu
Wed Mar 20 13:21:29 CDT 2013


I changed my mind, readData works just fine ;-)

On Mar 20, 2013, at 1:12 PM, Lorenzo Pesce wrote:

> I need to create a struct that will become more complex with time, let's say this is what it looks like now:
> 
> type Sample{
>    string name;
>    string dir;
> }
> 
> Then I need an array of such structs
> 
> Sample [] mySamples;
> 
> However, I would like to create the struct on the fly into the swift script itself. For arrays I would typically do
> string FileID [] = ["C440.TCGA-BR-7196-10A-01D-2053-08.2","C440.TCGA-CG-4477-10A-01D-1158-08.5"];
> 
> How can I do that for a struct? (I don't want to use readData, but I can if there is no other choice)
> 
> Thanks,
> 
> Lorenzo
> 
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user




More information about the Swift-user mailing list