From: <bi...@us...> - 2007-02-16 14:21:18
|
Revision: 119 http://svn.sourceforge.net/oorexx/?rev=119&view=rev Author: bigrixx Date: 2007-02-16 06:21:18 -0800 (Fri, 16 Feb 2007) Log Message: ----------- [ 1565805 ] Add DATATYPE() test for logical values Modified Paths: -------------- interpreter/trunk/kernel/classes/StringClassMisc.cpp Modified: interpreter/trunk/kernel/classes/StringClassMisc.cpp =================================================================== --- interpreter/trunk/kernel/classes/StringClassMisc.cpp 2007-02-15 21:46:58 UTC (rev 118) +++ interpreter/trunk/kernel/classes/StringClassMisc.cpp 2007-02-16 14:21:18 UTC (rev 119) @@ -370,15 +370,19 @@ break; case DATATYPE_LOGICAL: // Test for a valid logical. - // true if it's a valid logical value - if (String->isLogical()) + if (Len != 1 || (*Scanp != '1' && *Scanp != '0')) { - Answer = (RexxObject *)TheTrueObject; + Answer = TheFalseObject; } + else + { + Answer = TheTrueObject; + } + break; default : /* unsupported option */ - reportException(Error_Incorrect_method_option, (stringchar_t *)"ABCDLMNSUVWX9", new_string((stringchar_t *)&Option,1)); + reportException(Error_Incorrect_method_option, (stringchar_t *)"ABCDLMNOSUVWX9", new_string((stringchar_t *)&Option,1)); } return Answer; /* return validation answer */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |