// have to increment in case you don't get in the loop body
endRange.increment();
// check error so that if you are on the last verse in the
versification, you don't loop forever.
while (!endRange.Error() && myModule.isLinked(myKey, endRange)) {
endRange.increment();
}
At this point Error() (in the code below) will always return false.
It is cleared in the while loop above. Error() returns the error code
and brings low the error bit.
If endRange.Error() has returned true and myModule.isLinked(myKey,
endRange) returns false, exiting the loop, the call to myModule.isLinked
will set error on endRange?
No, simply the endRange.Error() call above will ALWAYS result in the
endRange.Error() call below to be false. The reason is that Error()
returns AND resets the error flag.
// If you hit the last verse you don't need to decrement
if (!endRange.Error()) {
endRange.decrement();
}
// test to see that you have a range.
if (myKey != endRange) {
... then I have a range ...
}
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page