Mark,

I think there may still be a small misunderstanding on your part on
how some of this works.  I noticed the following snippet from your
last checkin:

 /**
- * Return the number of existing arguments passed to a native API Rexx method,
- * (as opposed to the size of the argument array.)
+ * Return the number of existing arguments used in an ooRexx method invocation
+ * of a native API Rexx method.  In others words, it is intended to not count
+ * the pseudo-arguments like OSELF.
 *
+ * It may be obvious, or not, that in order for this to work, the order of the
+ * real ooRexx arguements need to be kept sequential in the
RexxMethodX function
+ * signatures.
+ *
 * @param context  The method context pointer for the native method.
+ * @param start    The starting position, 1-based of the real ooRexx args.
+ * @param end      The ending position, 1-based, of the real ooRexx args
 *
 * @return The count of existing arguments in the argument array.
 */
-size_t rxArgCount(RexxMethodContext * context)
+size_t rxArgCount(RexxMethodContext * context, size_t start, size_t end)
 {
    size_t j = 0;
-    size_t count = context->ArraySize(context->GetArguments());
-    for( size_t i = 1; i <= count; i++ )
+    for( size_t i = start; i <= end; i++ )
    {
        if ( argumentExists(i) )
        {

argumentExists() applies only to the arguments passed to the native
method, and that includes any pseudo arguments in the specification.
The array returned by context->getArguments() only returns the
arguments that are actually passed on the method call by the user.  If
there no pseudo arguments being used, these will match up.  Any pseudo
arguments will mess things up.  If you're dealing with the array
returned from context->GetArguments(), a more appropriate existence
test would be to test if the index position is NULLOBJECT.

Rick


On Thu, Dec 4, 2008 at 5:45 PM, Mark Miesfeld <[EMAIL PROTECTED]> wrote:
> On Thu, Dec 4, 2008 at 2:39 PM, Rick McGuire <[EMAIL PROTECTED]> wrote:
>> argumentExists() functions like the ARG() BIF.  The argument values
>> are are origin  1, not origin 0.  So the margin is the 5th argument,
>> as you've specified it in your signature.  The pseudo-arguments such
>> are counted here too, so argumentExists(5) is the correct thing to
>> specify.
>
> Thanks Rick.
>
> While on this subject, I've been putting the pseudo-arguments first in
> the list.  But, I got thinking when I was just looking at
> RexxNativeActivation, that you could put them anywhere in the list.
>
> And, I don't know why I was thinking this, but I was thinking you
> could only use 1 pseudo-argument.  (seems silly now.)
>
> But just to be explicit:
>
> A pseudo-arg can go in any position in the arg list, correct?
>
> You can use any number of pseudo-args in your function signature, correct?
>
> --
> Mark Miesfeld
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to