Skip to content

Loop over an Empty File Does Not Produce an Error #233

Answered by tmayerguerr
grkal asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Grigorios,

Sorry for my late answer.

I think groops does what I would expect: I know of no programming language in which an empty loop generates an error. Creating an empty ManualList, on the other hand, is pointless because the result is known at startup. This should not actually be configurable in the GUI.

If you want to change the source code you can add the line

  if(!count()) throw(Exception("empty loop"));

in classes/loop/loopFileAscii.h at the end of the constructor (near line 93).

Alternatively, the behavior can also be imitated in the script:
Create a loop->ManualList and a loop->fileAscii in the global section.
Then loop the element string with loopfileAscii (set loop) and s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@grkal
Comment options

Answer selected by grkal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants