From: SourceForge.net <no...@so...> - 2010-05-21 18:36:49
|
Bugs item #3005462, was opened at 2010-05-21 20:36 Message generated for change (Tracker Item Submitted) made by orexx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=3005462&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: APIs Group: v4.0.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Rony G. Flatscher (orexx) Assigned to: Nobody/Anonymous (nobody) Summary: StringLength() not returning correct string length, if Initial Comment: This is a very subtle error (took me a lot of time to trace down and finally finding the cause). If a RexxStringObject has a numeric value like "5" or "80", then StringLength() returns the numeric value of the Rexx string instead of the length of the strings (1 and 2 respectively). Sending the message "length" to the same RexxStringObject will return the correct string lengths: ... cut ... size_t len=context->StringLength(rso); // get length int32_t tmpLength=0; logical_t res=context->ObjectToInt32(context->SendMessage0(rso, "LENGTH"), &tmpLength); ... cut ... RexxStringObjects having the string value "5" or "80" will yield a value for "len" of 5 or 80, for "tmpLength" the correct values of 1 and 2, respectively. Again, quite a subtle problem (using StringLength in quite a few places in the external function package BSF4ooRexx and will have to change the code to switch to the message form if running on ooRexx 4.0.1 comparing REXX_CURRENT_INTERPRETER_VERSION against REXX_INTERPRETER_4_0_1). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=3005462&group_id=119701 |