[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue where return doesn't really return to octave prompt
From: |
Shai Ayal |
Subject: |
Re: Issue where return doesn't really return to octave prompt |
Date: |
Mon, 15 Aug 2005 20:50:45 +0200 |
This works for me on a self compiled octave 2.1.71 using gcc 3.3.3 on
cygwin WinXP.
I see no problem, the function returns to the octave prompt
Shai
On 8/15/05, address@hidden <address@hidden> wrote:
> I just tried a MUCH simpler test case and am seeing the same thing.
>
> Code Used
> -------------------------
> // Octave Includes
> #include<octave/oct.h>
> #include<octave/parse.h>
>
> #include <iostream>
> using namespace std;
>
> DEFUN_DLD(test_func,args,,"blah")
> {
> string testString = args(1).string_value();
>
> return octave_value();
> }
>
> Compile command line
> -----------------------------------
> mkoctfile test_func.cc
>
> Octave command line
> ---------------------------
> test_func(0,'TestFunc')
>
> Quoting "John W. Eaton" <address@hidden>:
>
> > On 15-Aug-2005, address@hidden wrote:
> >
> > | I am having an issue that has me baffled. An apparently small
> > change to code
> > | causes very unexpected results. The following snippet of code
> > shows both the
> > | case in which the problem does not occur and when it does occur. Also,
> > the
> > | error does not occur in Linux or OSX, only in Cygwin.
> > |
> > | DEFUN_DLD(hget,args,,"hget(handle,string)\n\
> > | gets a property for the given handle")
> > | {
> > |
> > | // Works here if uncommented
> > | //return octave_value();
> > |
> > | // Get the 'figure' object from the HandleManager
> > | handle* handlePtr = handle::getHandle( args(0).int_value() );
> > |
> > | // Works here if uncommented
> > | //return octave_value();
> > |
> > | // Make sure the handle retrieved is a 'handle' object
> > | if( (handlePtr != NULL) &&
> > | (handlePtr->type_id() == handle::static_type_id()) )
> > | {
> > | // Works here if uncommented
> > | //return octave_value();
> > |
> > | string propName = args(1).string_value();
> > |
> > | // Fails here - never returns to the octave prompt
> > | return octave_value();
> > | }
> > | else
> > | {
> > | error("handle: The handle id specified does not exist");
> > | }
> > |
> > | }
> > |
> > | Any suggestions?
> >
> > Are you sure the string_value function returns?
> >
> > jwe
> >
>
>
>
> ----------------------------------------------------------------
>
>
>
>