Re: Object passing



"James Tursa" <aclassyguywithaknotac@xxxxxxxxxxx> wrote in message <g3adt2$9m4$1@xxxxxxxxxxxxxxxxxx>...
"Christopher Madison" <rmadison@xxxxxxxxxxx> wrote in
message <g38s8u$1g1$1@xxxxxxxxxxxxxxxxxx>...
im trying to create a new class to handle a certain type of
file that i use regularly. i read in the data and it is
instantiated as an object of class 'a'. i have another
class, 'b' that is supposed to operate on an instance
of 'a'. however, when i try to call the constructor for
class 'b' with an instance of class 'a' i get an error
saying...

Maximum recursion limit of 500 reached. Use set
(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your
available stack space can
crash MATLAB and/or your computer.

So....can anyone tell me the dirty little secret i missed
the memo on? Thanks for any help

Sounds like you have an infinite recursion going on ... a
coding error on your part, most likely. Your constructor is
calling something else which is calling the constructor
which is calling something else which is calling the
constructor ... etc etc etc. Look for this type of error in
your code.

James Tursa




I have the same type of problem. The code is following:

file a.m:
classdef a< handle
properties
c= 0;
end
methods
function obj= a( c )
obj.c= c;
end
end
end

file b.m:
classdef b < handle
properties
a=[];
end
methods
function obj= b( a )
obj.a= a;
end
end
end

The following is typed in matlab command line:

aa= a(2)
aa =
a
bb= b(aa)
??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.

Error in ==> b

Can anybody explain this undocumented feature?
I use MATLAB 7.5.0.342

Thanks,
Mikhail Katkov
.



Relevant Pages

  • Re: Object passing
    ... Maximum recursion limit of 500 reached. ... crash MATLAB and/or your computer. ... Your constructor is ... calling something else which is calling the constructor ...
    (comp.soft-sys.matlab)
  • Re: Unusual usage of IUknown
    ... ptA = new A; ... calling V constructor, szData=V ... calling A destructor, szData=A ...
    (microsoft.public.vc.language)
  • Re: Unusual usage of IUknown
    ... char * szData; ... calling V constructor, szData=V ... calling A destructor, szData=A ...
    (microsoft.public.vc.language)
  • Re: Assembly problem
    ... Theodore ... > System.Windows.Forms is that the method you are calling GetCallingAssembly ... > the constructor is being invoked by assembly A. If A does not construct ... >> which in turn calls class B located in another dll file. ...
    (microsoft.public.dotnet.general)
  • Re: Delphi 6, 7 and... more ?
    ... TForm = class ... ... constructor Create; ... calling TForm1.Createwill call constructor ... AFormClass: TFormClass = TForm1; ...
    (borland.public.delphi.non-technical)