On Thu, Mar 18, 2010 at 2:58 PM, Brandon Cherry <bran...@safedatausa.com> wrote:
> In case anyone is interested I have a bit of a status update, I am
> getting records returned now!
> ...
> I have a problem with the attributes not getting set that are defined in
> a super class. Without my patch, this sample does not work for me. I get
> "SQLRETURN" instead of a number. I await feedback on this issue, before
> I continue.

Brandon / David,

I haven't had a chance to look at the code much, but I think that
problem is to be expected.  A quick glance at the C++ code shows that
SQLRETURN is getting set like this:

context->SetObjectVariable("SQLRETURN"

My understanding is that the SetObjectVariable API is setting an
*instance* variable in the context of the method.

This is the same as using expose in a subclass and then expecting the
attribute in the parent class to reflect the change.  It won't work.

/* qTest.rex */

 db = .dbconnx~new

 db~doSomeThing

 say 'sqlReturn:' db~SQLRETURN
 say 'sqlDiag:  ' db~SQLDIAG

::class 'cli' public

::attribute SQLRETURN
::attribute SQLDIAG

::class dbconnx public subclass cli

::method doSomeThing
  expose SQLRETURN SQLDIAG

  SQLRETURN = 15
  SQLDIAG = "Error"

Output:

C:\work.ooRexx\other>qTest.rex
sqlReturn: SQLRETURN
sqlDiag:   SQLDIAG

C:\work.ooRexx\other>

On the other hand this will work:

/* qTest.rex */

 db = .dbconnx~new

 db~doSomeThing

 say 'sqlReturn:' db~SQLRETURN
 say 'sqlDiag:  ' db~SQLDIAG

::class 'cli' public

::attribute SQLRETURN
::attribute SQLDIAG

::class dbconnx public subclass cli

::method doSomeThing
  expose SQLRETURN SQLDIAG

  self~SQLRETURN = 15
  self~SQLDIAG = "Error"

Output:

C:\work.ooRexx\other>qTest.rex
sqlReturn: 15
sqlDiag:   Error

C:\work.ooRexx\other>

That's why your patch worked Brandon, and the current code in the
incubator doesn't work.

--
Mark Miesfeld

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to