Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: findany

From: brett:codeconscious at: 24-Dec-2001 16:52

Hi Louis, Your function didn't do what you expected because BREAK does not return a value by default. You could use the /return refinement on BREAK though to return a TRUE. So you change if find x y [true break] to if find x y [break/return true] An alternative is to use the RETURN keyword instead of break. So you can use this instead: if find x y [return true] These two will work. In the case where the function does not find anything it returns none - which is probably what you want. For me I would probably add a "RETURN none" as the last line in the function to explicitly make this happen but this is a personal preference. HTH! Brett.