Hi, Thank you for the report. What I see is the result gets stuck
showing a value of 3. With MODE VERIFY turned on, the value of
($count) is for some reason evaluated too soon, so it is always
set to the value it has before that second loop starts, yes? repeat/range=1:3:1/name=count (def sym count = `count`; say ($count); message) This should be a syntax error, so yes, we'll look into why it is happening. It may have to do with how the the "message" command operates. If I replace that with something else, for instance, let b = 12, then it does report an error. yes? repeat/range=1:3:1/name=count (def sym count = `count`; say ($count); let b = 12))The single command, yes? message) does not result in a syntax error, though in other circumstances the lack of a paired ( ) would be an error. Ansley On 7/3/2017 12:49 PM, Riede, Hella
wrote:
Dear ferreters, I discovered that an additional round bracket at the end of a repeat statement does not lead to an error that exits the command but instead carries on with wrong / old values. Some statements within the loop are apparently then not executed anymore. Here's an example where the loop works as expected: NOAA/PMEL TMAP FERRET v7.1 (optimized) Linux 2.6.32-642.13.1.el6.x86_64 64-bit - 02/15/17 3-Jul-17 17:53 yes? repeat/range=1:3:1/name=count (def sym count = `count`; say ($count); message) 1 Hit Carriage Return to continue 2 Hit Carriage Return to continue 3 Hit Carriage Return to continue Here's an example where the loop has an additional round bracket at the end. The value of the ($count) symbol is not reassigned anymore despite 'def sym count = `count`': yes? repeat/range=1:3:1/name=count (def sym count = `count`; say ($count); message)) 4 Hit Carriage Return to continue 4 Hit Carriage Return to continue 4 Hit Carriage Return to continue Listing the variable 'count' as well shows that this values changes within the repeat loop as expected, so just the symbol statement seems to be skipped: yes? repeat/range=1:3:1/name=count (list count; def sym count = `count`; say ($count); message)) VARIABLE : constant 1.000 4 Hit Carriage Return to continue VARIABLE : constant 2.000 4 Hit Carriage Return to continue VARIABLE : constant 3.000 4 Hit Carriage Return to continue So in this way one might inadvertently end up with wrong values assigned to a symbol, or at least other values than expected. Best wishes, Hella |