You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
(2) |
Apr
(4) |
May
(35) |
Jun
(6) |
Jul
(23) |
Aug
(25) |
Sep
|
Oct
(72) |
Nov
(25) |
Dec
(13) |
2006 |
Jan
(104) |
Feb
(19) |
Mar
(43) |
Apr
(19) |
May
(62) |
Jun
(133) |
Jul
(44) |
Aug
(46) |
Sep
(68) |
Oct
(45) |
Nov
(97) |
Dec
(19) |
2007 |
Jan
(75) |
Feb
(232) |
Mar
(116) |
Apr
(368) |
May
(111) |
Jun
(134) |
Jul
(97) |
Aug
(107) |
Sep
(173) |
Oct
(579) |
Nov
(256) |
Dec
(213) |
2008 |
Jan
(242) |
Feb
(73) |
Mar
(26) |
Apr
(13) |
May
(10) |
Jun
(201) |
Jul
(367) |
Aug
(341) |
Sep
(246) |
Oct
(304) |
Nov
(104) |
Dec
(103) |
2009 |
Jan
(80) |
Feb
(183) |
Mar
(165) |
Apr
(302) |
May
(255) |
Jun
(136) |
Jul
(189) |
Aug
(107) |
Sep
(179) |
Oct
(94) |
Nov
(47) |
Dec
(86) |
2010 |
Jan
(102) |
Feb
(142) |
Mar
(86) |
Apr
(182) |
May
(77) |
Jun
(56) |
Jul
(14) |
Aug
(182) |
Sep
(117) |
Oct
(87) |
Nov
(76) |
Dec
(76) |
2011 |
Jan
(27) |
Feb
(196) |
Mar
(69) |
Apr
(26) |
May
(9) |
Jun
(54) |
Jul
(60) |
Aug
(49) |
Sep
(11) |
Oct
(38) |
Nov
(49) |
Dec
(32) |
2012 |
Jan
(61) |
Feb
(166) |
Mar
(72) |
Apr
(66) |
May
(33) |
Jun
(138) |
Jul
(89) |
Aug
(354) |
Sep
(61) |
Oct
(69) |
Nov
(60) |
Dec
(45) |
2013 |
Jan
(14) |
Feb
(13) |
Mar
(29) |
Apr
(52) |
May
(63) |
Jun
(68) |
Jul
(32) |
Aug
(13) |
Sep
(34) |
Oct
(49) |
Nov
(86) |
Dec
(219) |
2014 |
Jan
(101) |
Feb
(72) |
Mar
(50) |
Apr
(32) |
May
(99) |
Jun
(141) |
Jul
(89) |
Aug
(14) |
Sep
(137) |
Oct
(221) |
Nov
(18) |
Dec
(10) |
2015 |
Jan
(50) |
Feb
(12) |
Mar
(33) |
Apr
(86) |
May
(72) |
Jun
(90) |
Jul
(33) |
Aug
(9) |
Sep
(9) |
Oct
(27) |
Nov
(25) |
Dec
(9) |
2016 |
Jan
(16) |
Feb
(27) |
Mar
(16) |
Apr
(12) |
May
(23) |
Jun
(80) |
Jul
(127) |
Aug
(39) |
Sep
(12) |
Oct
(32) |
Nov
(20) |
Dec
(29) |
2017 |
Jan
(46) |
Feb
(77) |
Mar
(19) |
Apr
(36) |
May
(99) |
Jun
(45) |
Jul
(75) |
Aug
(53) |
Sep
(26) |
Oct
(57) |
Nov
(22) |
Dec
(4) |
2018 |
Jan
(11) |
Feb
(48) |
Mar
(80) |
Apr
(159) |
May
(41) |
Jun
(10) |
Jul
(36) |
Aug
(84) |
Sep
(76) |
Oct
(38) |
Nov
(177) |
Dec
(319) |
2019 |
Jan
(213) |
Feb
(244) |
Mar
(95) |
Apr
(48) |
May
(19) |
Jun
(3) |
Jul
(2) |
Aug
(17) |
Sep
(16) |
Oct
(35) |
Nov
(68) |
Dec
(20) |
2020 |
Jan
(16) |
Feb
(91) |
Mar
(244) |
Apr
(139) |
May
(13) |
Jun
(42) |
Jul
(29) |
Aug
(60) |
Sep
(53) |
Oct
(19) |
Nov
(63) |
Dec
(3) |
2021 |
Jan
(51) |
Feb
(72) |
Mar
(87) |
Apr
(31) |
May
(19) |
Jun
(73) |
Jul
(93) |
Aug
(31) |
Sep
(24) |
Oct
(79) |
Nov
(60) |
Dec
(24) |
2022 |
Jan
(49) |
Feb
(33) |
Mar
(13) |
Apr
(29) |
May
(92) |
Jun
(66) |
Jul
(64) |
Aug
(54) |
Sep
(22) |
Oct
(2) |
Nov
(23) |
Dec
(252) |
2023 |
Jan
(100) |
Feb
(121) |
Mar
(13) |
Apr
(43) |
May
(46) |
Jun
(24) |
Jul
(19) |
Aug
(8) |
Sep
(17) |
Oct
(15) |
Nov
(25) |
Dec
(24) |
2024 |
Jan
(43) |
Feb
(14) |
Mar
(40) |
Apr
(36) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark M. <mie...@gm...> - 2008-09-04 00:20:41
|
On Wed, Sep 3, 2008 at 5:14 PM, Rick McGuire <obj...@gm...> wrote: > I'm suspect I can guess a few of these. There will likely be some > failures caused by the default digits setting being 18 rather than 9. > I'd be willing to guess there are more than a few test cases that test > the edge conditions on the bifs/methods that expect values such as > 1000000000 to be an error. There's likely going to be a bit of > cleanup around these things. These reflect problems in the test cases > rather than the interpreter. Yes, I think that is going to be a lot of it. I still haven't looked at any actual test cases, but there are a lot in things like the addition and subtraction test groups. A lot in the string format test group. -- Mark Miesfeld |
From: Rick M. <obj...@gm...> - 2008-09-04 00:13:54
|
I'm suspect I can guess a few of these. There will likely be some failures caused by the default digits setting being 18 rather than 9. I'd be willing to guess there are more than a few test cases that test the edge conditions on the bifs/methods that expect values such as 1000000000 to be an error. There's likely going to be a bit of cleanup around these things. These reflect problems in the test cases rather than the interpreter. Any, of course, just getting the test suite to run to completion in 64-bit mode is HUGE! Rick On Wed, Sep 3, 2008 at 8:09 PM, Mark Miesfeld <mie...@gm...> wrote: > All, > > As you probably know if you follow the list, I've got a system set up > with 64-bit Windows. Actually it is multi-boot with a 64-bit XP and a > 64-bit Vista. > > ooRexx 4.0 was running with simple ooRexx programs but crashing with > more complicated ones. With the information I provided Rick, he was > able to fix the main problem. > > So I can proudly announce I'm the first person, ever, to see ooDialog > run on a 64-bit system. <grin> > > In addition, I was able run the entire automated test suite, to > completion. That is really significant, because the entire test suite > really exercises the interpreter. > > There were quite a lot of failed test cases, and I haven't even looked at why. > > I was just excited and wanted to post the good news. > > You really have to hand it to Rick. He not only was able to debug > this, but he debugged it remotely, without even being able to see the > debugger. ;-) > > Here is the test suite output: > > Interpreter: REXX-ooRexx_4.0.0(MT) 6.03 3 Sep 2008 > ooRexxUnit: 2.0.0_3.2.0 ooTest: 1.0.0_3.2.0 > > Tests ran: 16657 > Assertions: 544362 > Failures: 703 > (Known failures:) 0 > Errors: 355 > Exceptions: 0 > Skipped files: 1 > Messages: 0 > > File search: 00:00:05.554000 > Suite construction: 00:00:01.514000 > Test execution: 00:02:10.150000 > Total time: 00:02:17.499000 > > -- > Mark Miesfeld > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |
From: Mark M. <mie...@gm...> - 2008-09-04 00:08:54
|
All, As you probably know if you follow the list, I've got a system set up with 64-bit Windows. Actually it is multi-boot with a 64-bit XP and a 64-bit Vista. ooRexx 4.0 was running with simple ooRexx programs but crashing with more complicated ones. With the information I provided Rick, he was able to fix the main problem. So I can proudly announce I'm the first person, ever, to see ooDialog run on a 64-bit system. <grin> In addition, I was able run the entire automated test suite, to completion. That is really significant, because the entire test suite really exercises the interpreter. There were quite a lot of failed test cases, and I haven't even looked at why. I was just excited and wanted to post the good news. You really have to hand it to Rick. He not only was able to debug this, but he debugged it remotely, without even being able to see the debugger. ;-) Here is the test suite output: Interpreter: REXX-ooRexx_4.0.0(MT) 6.03 3 Sep 2008 ooRexxUnit: 2.0.0_3.2.0 ooTest: 1.0.0_3.2.0 Tests ran: 16657 Assertions: 544362 Failures: 703 (Known failures:) 0 Errors: 355 Exceptions: 0 Skipped files: 1 Messages: 0 File search: 00:00:05.554000 Suite construction: 00:00:01.514000 Test execution: 00:02:10.150000 Total time: 00:02:17.499000 -- Mark Miesfeld |
From: Rick M. <obj...@gm...> - 2008-09-03 16:41:35
|
Ok, here's a quick tutorial on adding a new C++ method to an existing ooRexx class. For illustration purposes, I'm going to use the isNull() method I just added to the Pointer class. Step 1) Write the new method. A method that is going to be exposed as an ooRexx method must have a return value that is either RexxObject *, or is a subclass of RexxObject * (e.g., RexxString *). Additionally, all arguments must also follow that same restriction. Like any other class, you add the declaration to the .hpp file: RexxObject *isNull(); And the implementation is in the .cpp file: /** * Test if this is a null pointer value. * * @return True if the pointer value is NULL, false for non-null. */ RexxObject *RexxPointer::isNull() { return pointer() == NULL ? TheTrueObject : TheFalseObject; } Now, in order for this to work, it needs to be added to the method dictionary for the target class. The method dictionary makes the mapping from the name "ISNULL" to the C++ code that implements the real method. This is done in the file Setup.cpp. So, in Setup.cpp, look for a reference to the class in question. In this case, searching for the string "RexxPointer::" will get me to the right place, since RexxPointer is the C++ class name of the ooRexx Pointer class. At this point, you'll see the code that manually adds each of the methods to the RexxPointer class. /* Add the instance methods to the */ /* instance behaviour mdict */ defineKernelMethod(CHAR_EQUAL,ThePointerBehaviour, CPPM(RexxPointer::equal), 1); defineKernelMethod(CHAR_BACKSLASH_EQUAL,ThePointerBehaviour, CPPM(RexxPointer::notEqual), 1); defineKernelMethod(CHAR_STRICT_EQUAL,ThePointerBehaviour, CPPM(RexxPointer::equal), 1); defineKernelMethod(CHAR_STRICT_BACKSLASH_EQUAL ,ThePointerBehaviour, CPPM(RexxPointer::notEqual), 1); (sorry about the formatting). This is adding the methods for the "=", "==", "\=", and "\==" methods. A similar line will add the isNull method: defineKernelMethod(CHAR_ISNULL, ThePointerBehaviour, CPPM(RexxPointer::isNull), 0); defineKernelMethod() adds a C++ method to an ooRexx class. The first argument is the name. CHAR_ISNULL I'll talk about below. The second argument is the behaviour object for the target class...the Pointer class. The behaviour object owns the method dictionary for methods that get added to class instances. The third argument is a function pointer for the real C++ method. The CPPM() macro casts this to a generic method pointer type. The final argument is the number of arguments the C++ macro expects. This one doesn't take any arguments, so we specify 0. If you try to compile this now, you're likely to get a compile error followed by a logic error during the image build. There's a couple more steps we need to take. Back to our friend CHAR_ISNULL. This is a character string constant from the interpreter central literal string pool. This is defined in RexxConstants.hpp, and we generally have simple mappings to most character string literal values. So, this adds CHARCONSTANT(ISNULL, "ISNULL"); to the list. CHAR_ISNULL is now defined. This usage is largely driven by IBM's standards for dealing with constants, and for many of these, we could directly use "ISNULL" in the defineKernelMethod() call, since this is the only usage of that value. It is sort of nice to keep things consistent though. The next step is updating the exported method table in CPPCode.cpp. Again, search for "RexxPointer::", and you'll find the other methods that have been exported for the RexxPointer class. This table is used to restore the classes save in the rexx.img file to point back to the real C++ classes when rexx.img is loaded. If the method is not include in this table, then a logicError() condition is raised during the rexximage buld phase. CPPM(RexxPointer::equal), CPPM(RexxPointer::notEqual), CPPM(RexxPointer::newRexx), +CPPM(RexxPointer::isNull), CPPM(RexxBuffer::newRexx), Voila, you're done. I recommend recompiling everything after doing this, but once the image has been rebuilt, the method will be available from ooRexx code. Rick |
From: Mike C. <MF...@uk...> - 2008-09-03 16:20:16
|
> Would an isNull() method satisfy your requirements for a test? Indeed, it's about the only way to do this, since the actual value of NULL is language- and/or implementation-defined. (In particular, it need not be 0, is often -1, and ISTR on some systems it was/is any odd value (i.e., LSB=1).) Mike Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU |
From: Rick M. <obj...@gm...> - 2008-09-03 15:34:51
|
Ok, I think I'm willing to add this much to the class. I'll go ahead and add this, and since this is an absolutely trivial example of adding a method to a class. I'll also do a writeup on what needs to be done to add a method when I'm done. Rick On 9/3/08, Mark Miesfeld <mie...@gm...> wrote: > On Wed, Sep 3, 2008 at 8:21 AM, Rick McGuire <obj...@gm...> wrote: > > Would an isNull() method satisfy your requirements for a test? > > > Yes, I think so. > > I was actually playing with this several weeks ago, and I guess my > memory is not that good. I first looked into trying to add something > like that to the class and could not see a clean way to do it, so I > gave up. But, I don't remember the details right now as to why I had > problems. ;-( > > > -- > Mark Miesfeld > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |
From: Mark M. <mie...@gm...> - 2008-09-03 15:30:30
|
On Wed, Sep 3, 2008 at 8:21 AM, Rick McGuire <obj...@gm...> wrote: > Would an isNull() method satisfy your requirements for a test? Yes, I think so. I was actually playing with this several weeks ago, and I guess my memory is not that good. I first looked into trying to add something like that to the class and could not see a clean way to do it, so I gave up. But, I don't remember the details right now as to why I had problems. ;-( -- Mark Miesfeld |
From: Rick M. <obj...@gm...> - 2008-09-03 15:21:11
|
Would an isNull() method satisfy your requirements for a test? Rick On 9/3/08, Mark Miesfeld <mie...@gm...> wrote: > On Wed, Sep 3, 2008 at 8:02 AM, David Ashley <da...@us...> wrote: > > Unfortunately, there are some circumstances where I need to know if a NULL > > pointer is being returned. The classic example is a search through a text > > buffer. I keep calling a method that returns a iter object (a pointer) until > > the function returns a NULL iter object (a NULL pointer). This lets me both > > count the number of time I found some search text and give me the > > opportunity to use the iter object to modify the text if I need to do that. > > > Rick this is similar to something I've been meaning to bring up. In > ooDialog, I also need to know when a null pointer is returned. > > I set this up to do it in the first intialization: > > RexxDirectoryObject local = context->GetLocalEnvironment(); > if ( local != NULLOBJECT ) > { > context->DirectoryPut(local, context->NewPointer(NULL), "NULLPOINTER"); > context->DirectoryPut(local, context->NumberToObject(0), > "SYSTEMERRORCODE"); > } > > Then in ooDialog classes I can test for .NullPointer. > > if p == .NullPointer then do > -- some problem > end > > The internal ooDialog classes need to know when a null pointer is > returned at times, because it is a valid return, but the action taken > is different when a null pointer is returned. > > -- > > Mark Miesfeld > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |
From: Mark M. <mie...@gm...> - 2008-09-03 15:17:30
|
On Wed, Sep 3, 2008 at 8:02 AM, David Ashley <da...@us...> wrote: > Unfortunately, there are some circumstances where I need to know if a NULL > pointer is being returned. The classic example is a search through a text > buffer. I keep calling a method that returns a iter object (a pointer) until > the function returns a NULL iter object (a NULL pointer). This lets me both > count the number of time I found some search text and give me the > opportunity to use the iter object to modify the text if I need to do that. Rick this is similar to something I've been meaning to bring up. In ooDialog, I also need to know when a null pointer is returned. I set this up to do it in the first intialization: RexxDirectoryObject local = context->GetLocalEnvironment(); if ( local != NULLOBJECT ) { context->DirectoryPut(local, context->NewPointer(NULL), "NULLPOINTER"); context->DirectoryPut(local, context->NumberToObject(0), "SYSTEMERRORCODE"); } Then in ooDialog classes I can test for .NullPointer. if p == .NullPointer then do -- some problem end The internal ooDialog classes need to know when a null pointer is returned at times, because it is a valid return, but the action taken is different when a null pointer is returned. -- Mark Miesfeld |
From: Rick M. <obj...@gm...> - 2008-09-03 14:56:38
|
Ok, I'm not sure I understand what you're trying to do here. The string value has no bearing at all on how Pointer object work or should be used. Under no circumstances should be you depending on that string value for anything. I'm not sure I'm entirely comfortable with you returning those as opaque objects to the programmer in the first place, but if you're depending on them exhibiting certain behaviors like that, then they are no longer opaque objects. Rick On 9/3/08, David Ashley <da...@us...> wrote: > > > Rick - > > Unfortunately your fix is not correct per your explanation. The NULL > pointer is now displayed as "0x0" and this is NOT EQUAL to "0" in Rexx. > > BTW, I still think that the NULL pointer should be equivalent to .nil in > Rexx. But that may not be correct for good reasons. > > Thanks, > W. David Ashley > IBM Systems and Technology Group Lab Services > Open Object Rexx Team > Mobile Phone: 512-289-7506 > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: David A. <da...@us...> - 2008-09-03 14:52:45
|
Rick - Unfortunately your fix is not correct per your explanation. The NULL pointer is now displayed as "0x0" and this is NOT EQUAL to "0" in Rexx. BTW, I still think that the NULL pointer should be equivalent to .nil in Rexx. But that may not be correct for good reasons. Thanks, W. David Ashley IBM Systems and Technology Group Lab Services Open Object Rexx Team Mobile Phone: 512-289-7506 |
From: Rick M. <obj...@gm...> - 2008-09-03 14:28:09
|
A NULL pointer value gets converted to a Pointer object with the value 0, not .nil. That's a bizarre string value, and it appears there's yet one more point of inconsistent behavior between Windows and Linux. Rick On 9/3/08, David Ashley <da...@us...> wrote: > > > Rick - > > I had assumed that if a C++ method returned a NULL pointer as a return > value, like this > > RexxMethod3(POINTER, // Return type > GrxTextBufferForwardSearch, // Object_method name > CSELF, self, // GTK self > CSTRING, text, // Search text > logical_t, flag) // Position boolean > { > > ... > > return NULL; > } > > that the NULL pointer would be converted to a .nil. Unfortunately that does > not seem to be the case. When I display a NULL pointer in the Rexx script I > get the following output. > > 0x(nil) > > Is this correct? > > Thanks, > W. David Ashley > IBM Systems and Technology Group Lab Services > Open Object Rexx Team > Mobile Phone: 512-289-7506 > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: David A. <da...@us...> - 2008-09-03 14:22:51
|
Rick - I had assumed that if a C++ method returned a NULL pointer as a return value, like this RexxMethod3(POINTER, // Return type GrxTextBufferForwardSearch, // Object_method name CSELF, self, // GTK self CSTRING, text, // Search text logical_t, flag) // Position boolean { ... return NULL; } that the NULL pointer would be converted to a .nil. Unfortunately that does not seem to be the case. When I display a NULL pointer in the Rexx script I get the following output. 0x(nil) Is this correct? Thanks, W. David Ashley IBM Systems and Technology Group Lab Services Open Object Rexx Team Mobile Phone: 512-289-7506 |
From: Rick M. <obj...@gm...> - 2008-09-02 20:41:27
|
No, but there is a POINTER type, which will handle the unwrapping of the Pointer object for you. Rick On 9/2/08, David Ashley <da...@us...> wrote: > > > FYI - the reason I have to cast a RexxObjectPtr to become a > RexxPointerObject is that there is no argument type for RexxPointerObject. > That is an invalid type for a method/function arguments or return value. > Maybe we should consider supplying that type for just this purpose. > > In the GTK case I pass back a RexxPointerObject to act as an opaque > iterator object that can act as an argument to subsequent methods. This > allows an iteration over a GTK collection. > > Thanks, > W. David Ashley > IBM Systems and Technology Group Lab Services > Open Object Rexx Team > Mobile Phone: 512-289-7506 > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: David A. <da...@us...> - 2008-09-02 20:21:16
|
FYI - the reason I have to cast a RexxObjectPtr to become a RexxPointerObject is that there is no argument type for RexxPointerObject. That is an invalid type for a method/function arguments or return value. Maybe we should consider supplying that type for just this purpose. In the GTK case I pass back a RexxPointerObject to act as an opaque iterator object that can act as an argument to subsequent methods. This allows an iteration over a GTK collection. Thanks, W. David Ashley IBM Systems and Technology Group Lab Services Open Object Rexx Team Mobile Phone: 512-289-7506 |
From: Rick M. <obj...@gm...> - 2008-09-02 19:19:51
|
Ok, I've fixed the formatting of the string value (another maddening Windows/Linux inconsistency), but the string value has no bearing on what value is returned by PointerValue(). That just returns the value stored in the Pointer instance. If you're seeing a null value, then it's got to be due to some other cause. You might want to use IsPointer() to double check that you're getting a pointer object in all the cases where you expect to get one. Rick On Tue, Sep 2, 2008 at 2:33 PM, David Ashley <da...@us...> wrote: > Like I said, these are RexxPointerObjects. I used this code > > say 'iter is' iter~class > say 'child is' child~class > > to produce this output. > > iter is The Pointer class > child is The Pointer class > > Thanks, > W. David Ashley > IBM Systems and Technology Group Lab Services > Open Object Rexx Team > Mobile Phone: 512-289-7506 > > > "Rick McGuire" ---09/02/2008 01:21:34 PM---There is a HUGE difference > between a "RexxObjectPtr" and a > > "Rick McGuire" <obj...@gm...> > Sent by: oor...@li... > > 09/02/2008 01:21 PM > > Please respond to > Open Object Rexx Developer Mailing List <oor...@li...> > > To > "Open Object Rexx Developer Mailing List" > <oor...@li...> > cc > > Subject > Re: [Oorexx-devel] NewPointer Method > There is a HUGE difference between a "RexxObjectPtr" and a > "RexxPointerObject". You cannot just cast a RexxObjectPtr into a > RexxPointerObject unless the instance truly IS an instance of > RexxPointerObject (i.e., created by NewPointer() originally or other > equivalent means (e.g. a POINTER return type from a method). What does > "say iter~class" display before the call to append? > > Rick > > On Tue, Sep 2, 2008 at 2:16 PM, David Ashley <da...@us...> wrote: >> Yes, parent is a RexxPointerObject. I have deliberately made the object >> opaque to the Rexx programmer. It is ALWAYS passed around as a >> RexxObjectPtr >> to the C++ method APIs and then converted. >> >> Thanks, >> W. David Ashley >> IBM Systems and Technology Group Lab Services >> Open Object Rexx Team >> Mobile Phone: 512-289-7506 >> >> >> "Rick McGuire" ---09/02/2008 01:13:40 PM---Is parent actually a >> RexxPointerObject instance (that would be the >> >> "Rick McGuire" <obj...@gm...> >> Sent by: oor...@li... >> >> 09/02/2008 01:11 PM >> >> Please respond to >> Open Object Rexx Developer Mailing List >> <oor...@li...> >> >> To >> "Open Object Rexx Developer Mailing List" >> <oor...@li...> >> cc >> >> Subject >> Re: [Oorexx-devel] NewPointer Method >> Is parent actually a RexxPointerObject instance (that would be the >> iter variable passed as an argument). I'm guessing it isn't, and you >> should instead be using context->ObjectToCSelf() and not >> PointerValue() to get the value out. The string form is never used >> for extracting the pointer value, so how the string form renders >> should have no bearing on whether you get a null value back. >> >> Rick >> >> On Tue, Sep 2, 2008 at 1:52 PM, David Ashley <da...@us...> wrote: >>> Here is a portion of the relevant Rexx code >>> >>> child = store~append(iter) >>> say child >>> >>> Here is the relevant C++ code >>> >>> RexxMethod2(RexxObjectPtr, // Return type >>> GrxTreeStoreAppend, // Object_method name >>> CSELF, self, // GTK self >>> RexxObjectPtr, parent) // Parent object >>> { >>> GtkTreeIter *piter = NULL; >>> GtkTreeIter iter; >>> >>> if (parent != context->Nil()) { >>> piter = (GtkTreeIter *)context->PointerValue((RexxPointerObject)parent); >>> } >>> gtk_tree_store_append(GTK_TREE_STORE(self), &iter, piter); >>> >>> return (RexxObjectPtr)context->NewPointer(gtk_tree_iter_copy(&iter)); >>> } >>> >>> This produces the error every time. >>> >>> Thanks, >>> W. David Ashley >>> IBM Systems and Technology Group Lab Services >>> Open Object Rexx Team >>> Mobile Phone: 512-289-7506 >>> >>> >>> "Rick McGuire" ---09/02/2008 12:26:37 PM---Well, give me a example that >>> demonstrates this. Are you sure you >>> >>> "Rick McGuire" <obj...@gm...> >>> Sent by: oor...@li... >>> >>> 09/02/2008 12:24 PM >>> >>> Please respond to >>> Open Object Rexx Developer Mailing List >>> <oor...@li...> >>> >>> To >>> "Open Object Rexx Developer Mailing List" >>> <oor...@li...> >>> cc >>> >>> Subject >>> Re: [Oorexx-devel] NewPointer Method >>> Well, give me a example that demonstrates this. Are you sure you >>> haven't accidentally mixed up a usage of a point object with a string >>> object some where? >>> >>> Rick >>> >>> On Tue, Sep 2, 2008 at 1:12 PM, David Ashley <da...@us...> wrote: >>>> Rick - >>>> >>>> Sometimes, but not all, the NewPointer method returns a >>>> RexxPointerObject >>>> like this >>>> >>>> 0x0x966d7e0 >>>> >>>> You can see this when you display the string value of the pointer. As >>>> you >>>> can see it has an extra 0x at the beginning. This obviously causes >>>> problem >>>> when you try to use this pointer :-) as it will be interpreted a a NULL >>>> pointer later. >>>> >>>> Would you please look into this? >>>> >>>> Thanks, >>>> W. David Ashley >>>> IBM Systems and Technology Group Lab Services >>>> Open Object Rexx Team >>>> Mobile Phone: 512-289-7506 >>>> >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>>> challenge >>>> Build the coolest Linux based applications with Moblin SDK & win great >>>> prizes >>>> Grand prize is a trip for two to an Open Source event anywhere in the >>>> world >>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>> _______________________________________________ >>>> Oorexx-devel mailing list >>>> Oor...@li... >>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>>> >>>> >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the >>> world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Oorexx-devel mailing list >>> Oor...@li... >>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the >>> world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Oorexx-devel mailing list >>> Oor...@li... >>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>> >>> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Oorexx-devel mailing list >> Oor...@li... >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Oorexx-devel mailing list >> Oor...@li... >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: Jack W. <ja...@we...> - 2008-09-02 18:56:47
|
David Ashley wrote: > > I cannot. Neither my ATT DNS servers or the IBM DNS servers can locate > the domain. > Yeah, there's definitely something skwooey about this. -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead |
From: Rick M. <obj...@gm...> - 2008-09-02 18:26:09
|
I'm able to get to it ok. Rick On Tue, Sep 2, 2008 at 2:11 PM, Jack Woehr <ja...@we...> wrote: > http://www.oorexx.org/ is "not found" and oorexx.sourceforge.net refers > to it ... is my browser sick or the DNS skewed? > > -- > Jack J. Woehr # "Self-delusion is > http://www.well.com/~jax # half the battle!" > http://www.softwoehr.com # - Zippy the Pinhead > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |
From: Rick M. <obj...@gm...> - 2008-09-02 18:21:08
|
There is a HUGE difference between a "RexxObjectPtr" and a "RexxPointerObject". You cannot just cast a RexxObjectPtr into a RexxPointerObject unless the instance truly IS an instance of RexxPointerObject (i.e., created by NewPointer() originally or other equivalent means (e.g. a POINTER return type from a method). What does "say iter~class" display before the call to append? Rick On Tue, Sep 2, 2008 at 2:16 PM, David Ashley <da...@us...> wrote: > Yes, parent is a RexxPointerObject. I have deliberately made the object > opaque to the Rexx programmer. It is ALWAYS passed around as a RexxObjectPtr > to the C++ method APIs and then converted. > > Thanks, > W. David Ashley > IBM Systems and Technology Group Lab Services > Open Object Rexx Team > Mobile Phone: 512-289-7506 > > > "Rick McGuire" ---09/02/2008 01:13:40 PM---Is parent actually a > RexxPointerObject instance (that would be the > > "Rick McGuire" <obj...@gm...> > Sent by: oor...@li... > > 09/02/2008 01:11 PM > > Please respond to > Open Object Rexx Developer Mailing List <oor...@li...> > > To > "Open Object Rexx Developer Mailing List" > <oor...@li...> > cc > > Subject > Re: [Oorexx-devel] NewPointer Method > Is parent actually a RexxPointerObject instance (that would be the > iter variable passed as an argument). I'm guessing it isn't, and you > should instead be using context->ObjectToCSelf() and not > PointerValue() to get the value out. The string form is never used > for extracting the pointer value, so how the string form renders > should have no bearing on whether you get a null value back. > > Rick > > On Tue, Sep 2, 2008 at 1:52 PM, David Ashley <da...@us...> wrote: >> Here is a portion of the relevant Rexx code >> >> child = store~append(iter) >> say child >> >> Here is the relevant C++ code >> >> RexxMethod2(RexxObjectPtr, // Return type >> GrxTreeStoreAppend, // Object_method name >> CSELF, self, // GTK self >> RexxObjectPtr, parent) // Parent object >> { >> GtkTreeIter *piter = NULL; >> GtkTreeIter iter; >> >> if (parent != context->Nil()) { >> piter = (GtkTreeIter *)context->PointerValue((RexxPointerObject)parent); >> } >> gtk_tree_store_append(GTK_TREE_STORE(self), &iter, piter); >> >> return (RexxObjectPtr)context->NewPointer(gtk_tree_iter_copy(&iter)); >> } >> >> This produces the error every time. >> >> Thanks, >> W. David Ashley >> IBM Systems and Technology Group Lab Services >> Open Object Rexx Team >> Mobile Phone: 512-289-7506 >> >> >> "Rick McGuire" ---09/02/2008 12:26:37 PM---Well, give me a example that >> demonstrates this. Are you sure you >> >> "Rick McGuire" <obj...@gm...> >> Sent by: oor...@li... >> >> 09/02/2008 12:24 PM >> >> Please respond to >> Open Object Rexx Developer Mailing List >> <oor...@li...> >> >> To >> "Open Object Rexx Developer Mailing List" >> <oor...@li...> >> cc >> >> Subject >> Re: [Oorexx-devel] NewPointer Method >> Well, give me a example that demonstrates this. Are you sure you >> haven't accidentally mixed up a usage of a point object with a string >> object some where? >> >> Rick >> >> On Tue, Sep 2, 2008 at 1:12 PM, David Ashley <da...@us...> wrote: >>> Rick - >>> >>> Sometimes, but not all, the NewPointer method returns a RexxPointerObject >>> like this >>> >>> 0x0x966d7e0 >>> >>> You can see this when you display the string value of the pointer. As you >>> can see it has an extra 0x at the beginning. This obviously causes >>> problem >>> when you try to use this pointer :-) as it will be interpreted a a NULL >>> pointer later. >>> >>> Would you please look into this? >>> >>> Thanks, >>> W. David Ashley >>> IBM Systems and Technology Group Lab Services >>> Open Object Rexx Team >>> Mobile Phone: 512-289-7506 >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the >>> world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Oorexx-devel mailing list >>> Oor...@li... >>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>> >>> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Oorexx-devel mailing list >> Oor...@li... >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Oorexx-devel mailing list >> Oor...@li... >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: Jack W. <ja...@we...> - 2008-09-02 18:20:10
|
http://www.oorexx.org/ is "not found" and oorexx.sourceforge.net refers to it ... is my browser sick or the DNS skewed? -- Jack J. Woehr # "Self-delusion is http://www.well.com/~jax # half the battle!" http://www.softwoehr.com # - Zippy the Pinhead |
From: Rick M. <obj...@gm...> - 2008-09-02 18:11:31
|
Is parent actually a RexxPointerObject instance (that would be the iter variable passed as an argument). I'm guessing it isn't, and you should instead be using context->ObjectToCSelf() and not PointerValue() to get the value out. The string form is never used for extracting the pointer value, so how the string form renders should have no bearing on whether you get a null value back. Rick On Tue, Sep 2, 2008 at 1:52 PM, David Ashley <da...@us...> wrote: > Here is a portion of the relevant Rexx code > > child = store~append(iter) > say child > > Here is the relevant C++ code > > RexxMethod2(RexxObjectPtr, // Return type > GrxTreeStoreAppend, // Object_method name > CSELF, self, // GTK self > RexxObjectPtr, parent) // Parent object > { > GtkTreeIter *piter = NULL; > GtkTreeIter iter; > > if (parent != context->Nil()) { > piter = (GtkTreeIter *)context->PointerValue((RexxPointerObject)parent); > } > gtk_tree_store_append(GTK_TREE_STORE(self), &iter, piter); > > return (RexxObjectPtr)context->NewPointer(gtk_tree_iter_copy(&iter)); > } > > This produces the error every time. > > Thanks, > W. David Ashley > IBM Systems and Technology Group Lab Services > Open Object Rexx Team > Mobile Phone: 512-289-7506 > > > "Rick McGuire" ---09/02/2008 12:26:37 PM---Well, give me a example that > demonstrates this. Are you sure you > > "Rick McGuire" <obj...@gm...> > Sent by: oor...@li... > > 09/02/2008 12:24 PM > > Please respond to > Open Object Rexx Developer Mailing List <oor...@li...> > > To > "Open Object Rexx Developer Mailing List" > <oor...@li...> > cc > > Subject > Re: [Oorexx-devel] NewPointer Method > Well, give me a example that demonstrates this. Are you sure you > haven't accidentally mixed up a usage of a point object with a string > object some where? > > Rick > > On Tue, Sep 2, 2008 at 1:12 PM, David Ashley <da...@us...> wrote: >> Rick - >> >> Sometimes, but not all, the NewPointer method returns a RexxPointerObject >> like this >> >> 0x0x966d7e0 >> >> You can see this when you display the string value of the pointer. As you >> can see it has an extra 0x at the beginning. This obviously causes problem >> when you try to use this pointer :-) as it will be interpreted a a NULL >> pointer later. >> >> Would you please look into this? >> >> Thanks, >> W. David Ashley >> IBM Systems and Technology Group Lab Services >> Open Object Rexx Team >> Mobile Phone: 512-289-7506 >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Oorexx-devel mailing list >> Oor...@li... >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: Rick M. <obj...@gm...> - 2008-09-02 17:24:08
|
Well, give me a example that demonstrates this. Are you sure you haven't accidentally mixed up a usage of a point object with a string object some where? Rick On Tue, Sep 2, 2008 at 1:12 PM, David Ashley <da...@us...> wrote: > Rick - > > Sometimes, but not all, the NewPointer method returns a RexxPointerObject > like this > > 0x0x966d7e0 > > You can see this when you display the string value of the pointer. As you > can see it has an extra 0x at the beginning. This obviously causes problem > when you try to use this pointer :-) as it will be interpreted a a NULL > pointer later. > > Would you please look into this? > > Thanks, > W. David Ashley > IBM Systems and Technology Group Lab Services > Open Object Rexx Team > Mobile Phone: 512-289-7506 > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |
From: David A. <da...@us...> - 2008-09-02 17:14:54
|
Rick - Sometimes, but not all, the NewPointer method returns a RexxPointerObject like this 0x0x966d7e0 You can see this when you display the string value of the pointer. As you can see it has an extra 0x at the beginning. This obviously causes problem when you try to use this pointer :-) as it will be interpreted a a NULL pointer later. Would you please look into this? Thanks, W. David Ashley IBM Systems and Technology Group Lab Services Open Object Rexx Team Mobile Phone: 512-289-7506 |
From: Mark M. <mie...@gm...> - 2008-08-30 15:27:51
|
Well this is very good, thanks Rick. I was closely looking at the changes you did in ooDialog. While the changes related to RexxIntegerObject were obvious, you had removed RexxIntegerObject, it was unclear to me why you changed some of the StringData() places. Makes more sense now. -- Mark Miesfeld On Sat, Aug 30, 2008 at 7:34 AM, Rick McGuire <obj...@gm...> wrote: > I think a little tutorial is in order for how some of the new APIs > work. On Thursday, I made a small correction in David's code for an > incorrect usage and today I found that Mark had made the same > fundamental mistake in some of the ole/oodialog code. Since I never > wrote this rules down, the mistake is definitely excusable. It is, > however, time to write these rules down. > > I want to start this off by noting that I just removed 3 of the APIs > from the vector. I removed the NewInteger, IntegerValue, and > IsInteger calls. These were sort of a holdover from the old 3.2.0 > API. These APIs are a little difficult, as they expose some details > of the ooRexx internals that are hard to document and these APIs are > very easy to misuse if you don't understand what's going on. > Additionally, these APIs don't offer any function that's not available > in other forms (ObjectToNumber, NumberToObject, etc.). These APIs do > the appropriate thing if the object is an Integer object anyway, so > these aren't really needed. > > Ok, now on to the tutorial problem area. The new APIs define a number > of opaque types that represent different object types. The base type > is RexxObjectPtr, which represents any arbitrary ooRexx object. Then > there are specific class types that can be specified as method > arguments or are used in particular API calls. > > General Rule #1: A RexxObjectPtr cannot be cast to a more specific > type (e.g., RexxStringObject) unless you are certain it is the correct > type. > > In both cases I saw over the last couple of days, There was code that > was something like this: > > const char *data = context->StringData((RexxStringObject)obj); > > Where obj is a value that is obtained as a RexxObjectPtr type. The > API call StringData() requires that the object in question actually be > a string instance. If you're holding a RexxObjectPtr, then you cannot > be certain that the value IS a string object unless you call > IsString() to verify it first. And you might discover that some > objects that you expect to be strings might not actually one. For > example, neither of the following method calls: > > a~foo(5) > a~foo(5.0) > > Passes a string object to the method as the first argument. The first > passes an Integer object, the second passes a NumberString object. > These are internal objects used to optimize arithmetic that masquerade > as string objects. Passing either to the StringValue() API will > produce unexpected results. > > There are several strategies you can use here. > > 1) Specify the argument type as RexxStringObject. If you know you > want a string, ask for a string. The runtime will convert Integer and > NumberString to string form for you, so everything will work ok. The > same is true if you use CSTRING. > > 2) If you're not able to specify the restricted type in the method > argument or you're dealing with a value obtained from another API that > returns a RexxObjectPtr (GetObjectVariable and SendMessage being two > examples), you can force this object to string form by calling > ObjectToString() to get this as a RexxStringObject type. Again, do > NOT use a cast for this. > > 3) If all you need is the CSTRING pointer from an object, then use > ObjectToStringValue() rather than StringData(). This API combines the > functions of ObjectToString() and StringData() in one call and will > always be safe to use. > > General Rule #2: The only time using a cast is acceptable is if you > used one of the IsXxxxx() APIs to check first. > > For example, > > if (context->IsArray(obj)) > { > RexxArrayObject aObj = (RexxArrayObject)obj; > ....yada yada yada... > } > > Is acceptable, but unconditionally casting obj to a (RexxArrayObject) > is dangerous unless you're sure it is the correct type. The only > situation where you can probably safely assume you have the correct > type if your native code is using > SetObjectVariable()/GetObjectVariable() to store a value that is only > manipulated via your own code. In that case, it's probably safe to > assume the value will be of the correct type. > > Generaly rule #3: It is dangerous to assume a string is a string > because of the existence of Integer and NumberString imposters. > > Even using IsString() to check the type won't really work because you > might end up rejecting instances of Integer and NumberString. Using > ObjectToString() and ObjectToStringValue() is always the best strategy > for dealing with this. > > > Rick > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |
From: Rick M. <obj...@gm...> - 2008-08-30 14:34:19
|
I think a little tutorial is in order for how some of the new APIs work. On Thursday, I made a small correction in David's code for an incorrect usage and today I found that Mark had made the same fundamental mistake in some of the ole/oodialog code. Since I never wrote this rules down, the mistake is definitely excusable. It is, however, time to write these rules down. I want to start this off by noting that I just removed 3 of the APIs from the vector. I removed the NewInteger, IntegerValue, and IsInteger calls. These were sort of a holdover from the old 3.2.0 API. These APIs are a little difficult, as they expose some details of the ooRexx internals that are hard to document and these APIs are very easy to misuse if you don't understand what's going on. Additionally, these APIs don't offer any function that's not available in other forms (ObjectToNumber, NumberToObject, etc.). These APIs do the appropriate thing if the object is an Integer object anyway, so these aren't really needed. Ok, now on to the tutorial problem area. The new APIs define a number of opaque types that represent different object types. The base type is RexxObjectPtr, which represents any arbitrary ooRexx object. Then there are specific class types that can be specified as method arguments or are used in particular API calls. General Rule #1: A RexxObjectPtr cannot be cast to a more specific type (e.g., RexxStringObject) unless you are certain it is the correct type. In both cases I saw over the last couple of days, There was code that was something like this: const char *data = context->StringData((RexxStringObject)obj); Where obj is a value that is obtained as a RexxObjectPtr type. The API call StringData() requires that the object in question actually be a string instance. If you're holding a RexxObjectPtr, then you cannot be certain that the value IS a string object unless you call IsString() to verify it first. And you might discover that some objects that you expect to be strings might not actually one. For example, neither of the following method calls: a~foo(5) a~foo(5.0) Passes a string object to the method as the first argument. The first passes an Integer object, the second passes a NumberString object. These are internal objects used to optimize arithmetic that masquerade as string objects. Passing either to the StringValue() API will produce unexpected results. There are several strategies you can use here. 1) Specify the argument type as RexxStringObject. If you know you want a string, ask for a string. The runtime will convert Integer and NumberString to string form for you, so everything will work ok. The same is true if you use CSTRING. 2) If you're not able to specify the restricted type in the method argument or you're dealing with a value obtained from another API that returns a RexxObjectPtr (GetObjectVariable and SendMessage being two examples), you can force this object to string form by calling ObjectToString() to get this as a RexxStringObject type. Again, do NOT use a cast for this. 3) If all you need is the CSTRING pointer from an object, then use ObjectToStringValue() rather than StringData(). This API combines the functions of ObjectToString() and StringData() in one call and will always be safe to use. General Rule #2: The only time using a cast is acceptable is if you used one of the IsXxxxx() APIs to check first. For example, if (context->IsArray(obj)) { RexxArrayObject aObj = (RexxArrayObject)obj; ....yada yada yada... } Is acceptable, but unconditionally casting obj to a (RexxArrayObject) is dangerous unless you're sure it is the correct type. The only situation where you can probably safely assume you have the correct type if your native code is using SetObjectVariable()/GetObjectVariable() to store a value that is only manipulated via your own code. In that case, it's probably safe to assume the value will be of the correct type. Generaly rule #3: It is dangerous to assume a string is a string because of the existence of Integer and NumberString imposters. Even using IsString() to check the type won't really work because you might end up rejecting instances of Integer and NumberString. Using ObjectToString() and ObjectToStringValue() is always the best strategy for dealing with this. Rick |