Hello, I also ran into the problem of generating source code. I wrote a C++ class to do it. It is attached. The following code fragment hopefully makes more or less clear how to use it exoutclass p; p.getfunction(symbol("matelsq"),matelsq); p.setfunction(eta,eta); p.setfunction(z,z); p.setfunction(xi,xi); p.setfunction(t,t); p.setfunction(s,s); ofstream hfile("regmsq.h"); hfile << "#include \"msq.h\"\n"; p.writeouth("regmsq","double",print_csrc_double(hfile),"msq"); hfile << "extern double mmu;" << endl; hfile << "extern double MW;" << endl; hfile.close(); ofstream Cfile("regmsq.C"); p.writeoutC("regmsq","double",print_csrc_double(Cfile)); Cfile << "double mmu=0;" << endl; Cfile << "double MW=" << MWval << ";" << endl; Cfile.close(); The idea is that this creates a C++ class with methods sets(), sett(), setxi(), setz() and seteta() and a method getmatelsq() that lets you get the result. The set methods should be called in opposite order as they are created with the setfunction methods. If you want to change, say, the value of xi, the methods setxi(), setz() and seteta() should be called in that order before calling getmatelsq(). In the setfunction the first argument should be a symbol of which the name occurs in the C++ output as a variable name, the second argument is the expression that gets a value by calling the appropriate setvariable() method. Bye, Chris Dams