Reading CSV file

Reading a CSV file.
In the CSV file the boolean fields come as 1 or 0, is there a better way to read them that:
if (NthField(rowFromFile,chr(asciiSeparator), 3).Val) = 1 then t.blocking = true

You also can write that line using the ternary “if” operator:

t.blocking = if (NthField(rowFromFile,chr(asciiSeparator), 3).Val = 1, true, false)

Javier

Thanks, I was wondering if there was an operator like .Val, or .Boolean like
Globals.ASWFinished = rs.Field(“ASWFinished”).BooleanValue

Well, in that case you can apply the technique exposed in this forum thread (the one based on a Module creation with a class method extension).

Javier

[quote=441114:@Enric Herrera]Reading a CSV file.
In the CSV file the boolean fields come as 1 or 0, is there a better way to read them that:
if (NthField(rowFromFile,chr(asciiSeparator), 3).Val) = 1 then t.blocking = true[/quote]

the CSV Parser from me :stuck_out_tongue:
http://www.great-white-software.com/Xojo_Code.html