# This example attempts to run ex1, fails, and writes the error
# message to the error file (no database is loaded).
phrSetErrorFileOn(TRUE)
phrSetErrorFileName(file.path(tempdir(), "phreeqc.errors"))
if (!is.null(try(phrRunString(ex1), silent=TRUE))) {
cat(paste("see ", phrGetErrorFileName(), ".\n", sep = ""))
}
Run the code above in your browser using DataLab