On 09.02.2012 13:52, Rick McGuire wrote: > On Thu, Feb 9, 2012 at 7:13 AM, Rony G. Flatscher > <[email protected]> wrote: >> While debugging new code I stumbled over the following observation: >> >> fetching a RexxObjectPtr from .local with: >> bsfClz=rtc->SendMessage0(rtc->GetLocalEnvironment(), "BSF"); >> >> getting the string representation (for debugging) of that ooRexx class >> object works with: >> rtc->CString(rtc->SendMessage0(clzBSF,"STRING")); >> >> whereas the following causes a crash: >> rtc->CString(rtc->SendMessage0(clzBSF,"MAKESTRING")); > This one is likely an error in your code. Unless your class > implements a MAKESTRING method, this will raise an exception and give > you a NULL return. Yes, you are right, just tested it: the MAKESTRING method (not implemented) caused a result of NULL which was immediately used as the argument for CString(), which therefore crashed.
---rony > The appropriate way to use MAKESTRING is to send > the REQUEST message with an argument of "STRING". However, that will > give you a .nil return if the object does not implement MAKESTRING. > The String method (and by extension, ObjectToString() or > ObjectToStringValue()) are the appropriate ways to obtain a string > value from an object. ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Oorexx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oorexx-devel
