Andrew and Gregg Thanks for your replies. It's particularly good to know that Andrew is now well enough to be answering mailing list questions.
I'm slowly learning that in Rebol everything depends on the underlying value and not the word. This is just one case where things happen differently depending on the underlying value. There are a number of such instances which trip me up at regular intervals, the main one being when things return none rather than a value of the type I was expecting eg find "12345" "7". I guess this is one part of the thinking differently needed for Rebol. Regards Peter On Wednesday, Nov 24, 2004, at 12:21 Asia/Kuala_Lumpur, Gregg Irwin wrote: > > Hi Peter, > > PWW> I'm a bit confused about the behaviour of copy/part as it appears > PWW> inconsistent: > > PWW> >> str: "123456789" > PWW> == "123456789" > PWW> >> copy/part str find str "9" > PWW> == "12345678" > PWW> >> copy/part str index? find str "9" > PWW> == "123456789" > > It may not be as clear as it could be from the help string, but it > makes sense: > > /part -- Limits to a given length or position. > range -- (Type: number series port pair) > > So, the distinction is that an integer (when you use INDEX?) specifies > a length, while giving a series (the result of FIND STR "9") specifies > a position (think of it as "up to" the position). > > -- Gregg > > -- > To unsubscribe from the list, just send an email to rebol-request > at rebol.com with unsubscribe as the subject. > > -- To unsubscribe from the list, just send an email to rebol-request at rebol.com with unsubscribe as the subject.
