[Swift-user] Could not convert value to number: true

Ben Clifford benc at hawaga.org.uk
Mon Jun 25 22:11:45 CDT 2007


Hi.

The csv_mapper only maps the filename of datafiles into an array. It 
doesn't map actual data itself.

So this:


> type student {    string name;    int    age;    float  GPA;
> } 

> student p[]<csv_mapper;file="student.txt">;

says to make an array called p[], and the filename that indicates where 
data is stored for each field in student comes from each field in 
student.txt.

Also, when you say this:

> int age = p[0].age * 4;

swift thinks that the data in p[0].age is stored in a disk file (because 
it is mapped) and in that case, can't multiple the contents of a file by a 
number.

-- 



More information about the Swift-user mailing list