help-octave
[Top][All Lists]
Advanced

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

Re: Get Global values in Oct file


From: Kai Torben Ohlhus
Subject: Re: Get Global values in Oct file
Date: Thu, 31 Oct 2019 11:28:44 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

On 10/31/19 1:52 AM, Carlo De Falco wrote:
> 
> 
>> Il giorno 30 ott 2019, alle ore 17:01, babelproofreader <address@hidden> ha 
>> scritto:
>>
>> How to access global values in an oct file? When I try using
>> get_global_value() I get the warning
>>
>> warning: ‘octave_value get_global_value(const string&, bool)’ is deprecated:
>> [4.4]: use 'symbol_table::global_varval' instead [-Wdeprecated-declarations]
>>
>> What is the new way of using 'symbol_table::global_varval'? I cannot find
>> any documentation for this. I'm using Octave 5.1.0 on a Linux system. 
> 
> There is not much documentation, but the definition of 
> symbol_table::global_varval
> is given here :
> 
> http://octave.org/doxygen/5.1/d8/d9b/symtab_8h_source.html#l00161
> 
> and it looks pretty much self explaining ...
> 
> c.
> 

Hmm, there is really not much documentation.  I attached an overhauled
version of Octave's globaldemo.cc example.

@jwe: can you confirm that this is the right way to go in the future
with including the interpreter and using DEFMETHOD_DLD?  See your cset:

   https://hg.savannah.gnu.org/hgweb/octave/rev/b29904962d2d

Then I can update the demo to cause less confusion.  At least it
compiles and works for me without errors and warnings:

octave:1> mkoctfile globaldemo.cc
octave:2> globaldemo ("hi")
ans = Global variable not found
octave:3> global a
octave:4> a
a =  42
octave:5> global hi
octave:6> hi = "wuff"
hi = wuff
octave:7> globaldemo ("hi")
ans = wuff

HTH,
Kai

Attachment: globaldemo.cc
Description: Text Data


reply via email to

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