Hey guys
Basically I have loop which looks like this:
function readVtkVariables(filename::String,reset::Bool)
k::Array{String} = []
#Open the specific file
fd::IOStream = open(filename, read=true)
for i in instances(Cat)
#Read until the specific enum string has been found. Ie. Mk => "Mk " etc.
if reset == true
seek(fd,0)
else
end
readuntil(fd, searchString[i])
k = push!(k,string(i))
end
return k
end
What I would like to do is to set the “reset” input as false always, unless otherwise stated. So basically I want the user to be able to write, this which would be the same thing:
readVtkVariables("PartSquare_0000.vtk")
readVtkVariables("PartSquare_0000.vtk",false)
I know I could do multiple dispatch, but I think that shouldn’t be necessary for this short code.
Kind regards