help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exporting a variable to the global workspace from a C++ function


From: John W. Eaton
Subject: Re: Exporting a variable to the global workspace from a C++ function
Date: Wed, 12 Aug 2009 10:53:11 -0400

On 12-Aug-2009, Justin Bare wrote:

| I tried this as you suggested:
| 
|     symbol_table::global_varref("x") = 9;
|     symbol_table::set_scope(symbol_table::top_scope);
|     symbol_table::insert("x").mark_global();
| 
| but I get compiler errors that say:
| 
|     readbuf.cpp:29: error: \x91global_varref\x92 is not a member of 
\x91symbol_table\x92
|     readbuf.cpp:30: error: \x91set_scope\x92 is not a member of 
\x91symbol_table\x92
|     readbuf.cpp:30: error: \x91top_scope\x92 is not a member of 
\x91symbol_table\x92
|     readbuf.cpp:31: error: \x91insert\x92 is not a member of 
\x91symbol_table\x92
| 
| even though I have included the Octave/C++ library
| 
| How do I make this compile?

Your earlier method of using set_global_value was the right way to
install a global variable.  But I think you are confused about how to
access globals from the interpreter prompt.
| 
| > On Wed, Aug 12, 2009 at 2:59 PM, Justin
| > Bare<address@hidden> wrote:
| >> I tried the function you gave me in this way inside a C++ function:
| >> 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]