From 805d01c7858213a901da030dcdb48aea5a7da1b1 Mon Sep 17 00:00:00 2001 From: Michel Juillard Date: Sun, 20 Nov 2011 14:48:01 +0100 Subject: [PATCH] use "clear -all" instead of "clear all" when running under Octave --- ModFile.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ModFile.cc b/ModFile.cc index e9bce221..3e70440f 100644 --- a/ModFile.cc +++ b/ModFile.cc @@ -442,7 +442,13 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool console, << "% from model file (.mod)" << endl << endl; if (clear_all) - mOutputFile << "clear all" << endl; + { + mOutputFile << "if exist('OCTAVE_VERSION')" << endl + << " clear -all" << endl + << "else" << endl + << " clear all" << endl + << "end" << endl; + } mOutputFile << "tic;" << endl << "global M_ oo_ options_ ys0_ ex0_" << endl