Re: Endless Loop
- Posted by Michael Bolin <michaeltom at GEOCITIES.COM> Apr 21, 1997
- 830 views
> Well I've done it again. I've gotten myself in a mess that only the > gallant heroes of the Euphoria for DOS Mailing List can fix. Below is > source for a routine I'm writing. I found out through the with trace > statement that I'n an endless loop, BUT I can't figure out why. > Someone PLEASE tell me where I'm misreading code. Thanks a bunch > guys. First of all, you need to change your two lines that say return{s2} to return {s1} Otherwise, you'll get an error if the original string contains no spaces. To fix the endless loop problem, change your line that says s2 = s2 & s1[x..y] to s1 = s2 & s1[x..y] Your problem was that the find() command kept searching the original string for spaces, and you never changed the original, so it kept finding the first space. Regards, Michael Bolin