Data / Copy block error display

Issue #161 resolved
Turgut Guneysu created an issue

Data/copy block does NOT display any errors when an index is used that is out of range.

For consistency, it should either produce a -1 as in “find” or “List or string index out of range” as in “replace” block.

Similar treatment might be suitable for 'join” block with empty parameters.

Comments (3)

  1. John Maloney repo owner

    These are the intended behaviors. You get an empty string (or list) if the range you copy is beyond the end of the list. The result of the operation is always a string; having it sometimes return a number (-1) would result in either more complex code or errors when trying to treat the result as a string.

    Join of two strings is a string containing the contents of both strings concatenated. If both strings happen to be empty, the result is an empty string.

  2. Log in to comment