From: Rick M. <obj...@gm...> - 2009-03-19 00:13:55
|
This sounds like a bug to me, but I suspect I need an example I can run to figure it out. Where is the code in error? Is it in the called routine, in the prolog section of the package? Rick On Wed, Mar 18, 2009 at 8:06 PM, Mark Miesfeld <mie...@gm...> wrote: > Directed to Rick, because I don't know who else can answer it, > > So I've been fooling with the RexxCreateInterpreter() and the APIs. I > have an example program that works great, as long as there is not an > error in the file I use LoadPackage() on. > > In semi-pseudo code this is what I'm doing in a C++ program. (My C++ > which is mostly writing C with an extension of .cpp. <grin>) > > char *packageName = "nutshell_1b.rex"; > ... > if ( RexxCreateInterpreter(&interpreter, &threadContext, options) == 0 ) > exit > ... > RexxPackageObject nutshellPkg = threadContext->LoadPackage(packageName); > if ( nutshellPkg == NULLOBJECT ) > { > if (threadContext->CheckCondition()) > { > print out some stuff > } > exit on error > } > > continue ... > > The nutshell_1b.rex has a couple of class definitions and a routine > definition. I then basically do > > routineObj = get routine object from pkg > classObj = get class object from pkg > > obj = classObj instantiate > > RexxObjectPtr result = threadContext->CallRoutine(routineObj, NULL); > do something with obj > > As long as the code in the in the file nutshell_1b.rex is good, > everything works fine. But if I put this in the file: > > say 'mathRound:' 3/0 > > I expected to get a condition object. Instead I get a crash where the > C run time prints out: > > This application has requested the Runtime to terminate it in an unusual way. > Please contact the application's support team for more information. > > If I run a regular Rexx program that looks like this: > > say 'In qtest' > > ::requires "nutshell_1b.rex" > > I get this: > > C:\work.ooRexx\other\examples\4.0.examples>qtest.rex > 3 *-* say 'mathRound:' 3/0 > 4 *-* ::requires "nutshell_1b.rex" > Error 42 running > C:\work.ooRexx\other\examples\4.0.examples\nutshell_1b.rex line 3: > Arithmetic overflow/underfl > ow > Error 42.3: Arithmetic overflow; divisor must not be zero > > I sort of see why, the qTest.rex program has an extra > RexxActivation::run(). It hits this loop: > > /* loop to the top of the stack */ > while (activation != OREF_NULL && !activation->isStackBase()) > { > > enters it, and gets thrown to this catch > > catch (RexxNativeActivation *) > { > } > > in RexxActivation::run() > > On the other hand, the C++ program hits the while loop and never > enters it. Instead it hits this->kill() where the UnhandledCondition > exception is thrown and never caught. > > And then I'm stumped. Is this a fixable bug? Something that nothing > can be done about? Or, I'm using the APIs wrong? > > -- > Mark Miesfeld > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |