CXX Q: initialize variable to a value

Hoon yelled at yahoo.com
Thu Oct 10 15:31:24 CEST 2002


Hi:

  I am attempting to initialize dbg variable to -1, but I cannot use
init function to change this. Anyone have a good idea?
  Please e-mail me back. yelled at yahoo.com
  TIA,

Hoon,
-------------source code--------------------
class QALApi_module : public ExtensionModule<QALApi_module> {
    public:
    QALApi_module() : ExtensionModule<QALApi_module>( "QALApi" ){
	add_varargs_method("DBG", &QALApi_module::ex_DBG, "");
    }
    virtual ~QALApi_module() {}

    private:
    int dbg;
    void init() { dbg = -1;}  // *******WHY DOESN'T THIS
WORK????******
    Object ex_DBG(const Tuple &args) {
	try {
	    args.verify_length(1);
	}
	catch (Exception& e) {
	    e.clear();
	    return Int(dbg);
	}
	    Int pyDbg(args[0]);
	    dbg			= int(pyDbg);
	    return Int(dbg);
	} // ex_DBG



More information about the Python-list mailing list