The best solution is to check for return values of functions - for example, check that a data access function returned a value rather than nil - before using it in an expression.
That way you can handle errors gracefully rather than just causing an expression to fail. For example:
Code:when(out=v("/out" ?result 'tran)
fft=dft(out ...)
)
or:
Code:if(out=v("/out" ?result 'tran) then
fft=dft(out ...)
else
printf("Transient analysis failed\n")
)
If for example the transient didn't run for some reason, v() will return nil, and so it won't try and do the dft on nil.
loadi() is one approach, but it's messy and doesn't really allow you to gracefully handle the errors.
Best Regards,
Andrew.