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

Luciano Piccoli piccoli at fnal.gov
Mon Jun 25 22:51:45 CDT 2007


   

> 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.
>   

What happens in the following cases?

    int age = p[0].age;
    outfile = sayAge (age);

Does the variable age gets read from the file at the first line? Is it 
an integer at that point or is it still a reference to the file? If the 
variable age is then used later the conversion error comes up again:

    int age = p[0].age;
    int age2 = age * 2;
    outfile = sayAge (age);

Thanks,
Luciano



More information about the Swift-user mailing list