history[currentHistoryLine] = s; currentHistoryLine++;
AppendHistoryLine(s);
  public void start()  {    if (yacasLogo == null)    {      try      {        String fname = getDocumentBase().toString();        int ind = fname.lastIndexOf("/");        if (ind >0)        {          fname = fname.substring(0,ind+1)+"yacas.gif";          yacasLogo = getImage(new URL(fname));        }      }      catch (Exception e)      {      }    }    stdoutput = new StringOutput(outp);    yacas = new CYacas(stdoutput);    yacas.env.iCurrentInput = new CachedStdFileInput(yacas.env.iInputStatus);    if (yacasLogo != null)    {      lines[currentLine] = new ImageLine(yacasLogo,this);      currentLine = (currentLine+1)%nrLines;    }    {      Font font = new Font("helvetica", Font.PLAIN, 12);      Color c = new Color(96,96,96);      AddLineStatic(100, "","", font, c);      AddLineStatic(100, "","", font, c);      AddLineStatic(100, "","This is Yacas version '" + CVersion.VERSION + "'.", font, c);      AddLineStatic(100, "","Yacas is Free Software--Free as in Freedom--so you can redistribute Yacas or", font, c);      AddLineStatic(100, "","modify it under certain conditions. Yacas comes with ABSOLUTELY NO WARRANTY.", font, c);      AddLineStatic(100, "","See the GNU General Public License (GPL) for the full conditions.", font, c);//TODO fixme    AddLineStatic(100, "","Type ?license or ?licence to see the GPL; type ?warranty for warranty info.", font, c);      AddLineStatic(100, "","See http://yacas.sf.net for more information and documentation on Yacas.", font, c);      AddLineStatic(100, "","Numeric mode: \""+BigNumber.NumericLibraryName()+"\"\n", font, c);//TODO fixme    AddLineStatic(100, "","To exit Yacas, enter  Exit(); or quit or Ctrl-c.\n", font, c);      AddLineStatic(100, "","", font, c);      AddLineStatic(100, "","Type '?', '??' or 'help' for help, or type '?function' for help on a function.\n", font, c);      AddLineStatic(100, "","Type 'restart' to restart Yacas, or 'cls' to clear screen.\n", font, c);      AddLineStatic(100, "","To see example commands, keep typing 'Example();'\n", font, c);    }    {      String docbase = getDocumentBase().toString();      if (docbase.substring(0,4).equals("file"))      {        int pos = docbase.lastIndexOf("/");        String zipFileName = docbase.substring(0,pos+1)+"scripts.zip";        try        {        //  java.util.zip.ZipFile z = new java.util.zip.ZipFile(new File(new java.net.URI("file:/Users/ayalpinkus/projects/JavaYacas/tempscripts.zip")));          java.util.zip.ZipFile z = new java.util.zip.ZipFile(new File(new java.net.URI(zipFileName)));          LispStandard.zipFile = z;//          out.println("Succeeded in finding "+zipFileName);        }        catch(Exception e)        {          out.println("Failed to find scripts.zip");          out.println(""+zipFileName+" : \n");          out.println(e.toString());        //  return;        }      }    }    try    {//      PerformRequest("Connected: version of engine is ","Atom(Version())");      out.println("");    }    catch (Exception e)    {      out.println(e);    }     int i;    i=1;    while (true)    {      String argn = "init"+i;      String s = getParameter(argn);      if (s == null) break;      s = unescape(s);      yacas.Evaluate(s);      i++;    }    i=1;    while (true)    {      String argn = "history"+i;      String s = getParameter(argn);      if (s == null) break;      s = unescape(s);      history[currentHistoryLine] = s;      currentHistoryLine++;      i++;    }    ResetInput();  }