Hi UzzyWould using %L in your printf/fprintf cmds in place of %s, %d, %f, etc help? Or perhaps you can add a check in your script to detect nil results:unless( results results="0.0") ;unlessprintf("Results are %g\n" results)Best regardsQuek
I tend to use things like:
when(member('tran results()) ; do the stuff that depends upon the transient having run)
If the tran didn't run because of a problem (you could use a similar approach for other analyses), there will be no results in the simulation result database - so checking for it is an easy way of catching gross failure.
Alternatively, using the approach proposed by Quek (the unless bit) is a good idea. I'm less keen on the %L approach - it's less flexible in how it can be formatted, and it doesn't help if you tried doing:
outData=v("/out" ?result 'tran)double=outData*2
in this case the double calculation will fail if the tran results are not present, because it will try to do nil*2.
I wanted to add to what Quek and Andrew have suggested. If you did not need to perform any calculation, just printing, you might use a variation on Quek's method that is a little more succinct:
printf("Results are %g\n" results || 0.0) ;; supplies 0.0 result if "results" is nil
By the way, in Quek's post there are double quotes around the 0.0 but I don't think they should be there.
Hi LawrenceThanks. : )Best regardsQuek