[Cobolforgcc-devel] STRING
Status: Pre-Alpha
Brought to you by:
timjosling
From: Steven O. E. <so...@so...> - 2001-03-03 15:24:41
|
According to the standard (below), pointer offset must be set to a value greater than 0 before the string routine is called. And since both pointer offset and delimiter count are defined as COB_UINT32 within cobr_string.c, I have changed the test routines in test_cobr_string.c to be consistent with cobr_string.c. I changed COB_INT32 pointer_offset COB_INT32 delimiter_count to COB_UINT32 pointer_offset COB_UINT32 delimiter_count. Also, the initial coding of cobr_string.c allowed a pointer_offset of 0. I have changed that to an overflow condition and put it in debug code: #ifndef NDEBUG if (pointer_offset == 0) return 1; #endif 6.25.2 General Format STRING { {identifier-l | literal-l} ... DELIMITED BY {identifier|literal|SIZE} } ... INTO identifier-3 [WITH POINTER identifier-41 [ON OVERFLOW imperative-statement-l [NOT ON OVERFLOW imperative-statement-21 [END-STRING] 6.25.3 Syntax Rules . . . (5) If the POINTER phrase is specified, the data item referenced by identifier-4 must be set to an initial value greater than zero prior to the execution of the STRING statement. (6) If the POINTER phrase is not specified, the following general rules apply as if the user had specified identifier-4 referencing a data item with an initial value of 1. . . . |