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

How to use parenthesis

 [1/5] from: richard::coffre::francetelecom::com at: 17-Apr-2002 15:41


Hi Rebolers, I have this instruction : tcr: remove/part copy/part ligne 11 9 but I need to have something like this : offset: 7 tcr: remove/part copy/part ligne (4 + offset) (2 + offset) SO far, it doesn't work ??? Richard Coffre France Telecom Orbiscom T=E9l. : 01 47 61 46 28 Share what you know, learn what you don't

 [2/5] from: greggirwin:mindspring at: 17-Apr-2002 11:17


Hi Richard, << I have this instruction : tcr: remove/part copy/part ligne 11 9 but I need to have something like this : offset: 7 tcr: remove/part copy/part ligne (4 + offset) (2 + offset) SO far, it doesn't work ??? >> I get the same results here. Is the result wrong for both of them?
>> ligne: "1234567890ABCDEF"
== "1234567890ABCDEF"
>> offset: 7
== 7
>> tcr: remove/part copy/part ligne (4 + offset) (2 + offset)
== "0A"
>> tcr: remove/part copy/part ligne 11 9
== "0A" --Gregg

 [3/5] from: carl:cybercraft at: 18-Apr-2002 7:57


On 18-Apr-02, COFFRE Richard FTO wrote:
> Hi Rebolers, > I have this instruction :
<<quoted lines omitted: 3>>
> tcr: remove/part copy/part ligne (4 + offset) (2 + offset) > SO far, it doesn't work ???
Hi Richard, It depends what you mean by "work". It doesn't return an error...
>> ligne: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
== [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
>> offset: 7
== 7
>> tcr: remove/part copy/part ligne (4 + offset) (2 + offset)
== [10 11]
>> tcr
== [10 11] and gives the same result as...
>> tcr: remove/part copy/part ligne 11 9
== [10 11] so I assume it's not giving the result you want? If that's the case, you'll need to tell us what result is wanted. The following, broken into its parts, is what's happening above...
>> a: copy/part ligne (4 + offset)
== [1 2 3 4 5 6 7 8 9 10 11]
>> tcr: remove/part a (2 + offset)
== [10 11] If, by offset you mean you want to move into the series a certain amount, use skip to do it. ie...
>> a: copy/part skip ligne offset 4
== [8 9 10 11] Though that doesn't make sense with your example as you'd always be left with an empty series...
>> tcr: remove/part skip a offset 2
== [] Though perhaps you just mean...
>> tcr: remove/part a 2
== [10 11] ? if so, then the one-liner would be...
>> tcr: remove/part copy/part skip ligne offset 4 2
== [10 11] But if not ??? -- Carl Read

 [4/5] from: chalz:earthlink at: 18-Apr-2002 0:39


Here's what I get in /Core:
>> line: "abcdefghijklmnopqrstuvwxyz"
== "abcdefghijklmnopqrstuvwxyz"
>> tcr: remove/part copy/part line 11 9
== "jk"
>> offset: 7
== 7
>> line
== "abcdefghijklmnopqrstuvwxyz"
>> tcr: remove/part copy/part line (4 + offset) (2 + offset)
== "jk"
>>
How is that not working? ----- Original Message ----- From: "COFFRE Richard FTO" <[richard--coffre--francetelecom--com]> To: <[rebol-list--rebol--com]> Sent: Wednesday, April 17, 2002 9:41 AM Subject: [REBOL] How to use parenthesis Hi Rebolers, I have this instruction : tcr: remove/part copy/part ligne 11 9 but I need to have something like this : offset: 7 tcr: remove/part copy/part ligne (4 + offset) (2 + offset) SO far, it doesn't work ??? Richard Coffre France Telecom Orbiscom Tél. : 01 47 61 46 28 Share what you know, learn what you don't

 [5/5] from: richard:coffre:francetelecom at: 18-Apr-2002 8:11


I'm really confused but when I test it the first time it failed but as you mentioned it works now so ... ;-) Richard -----Message d'origine----- De : Gregg Irwin [mailto:[greggirwin--mindspring--com]] Envoy=E9 : mercredi 17 avril 2002 19:17 =C0 : [rebol-list--rebol--com] Objet : [REBOL] Re: How to use parenthesis Hi Richard, << I have this instruction : tcr: remove/part copy/part ligne 11 9 but I need to have something like this : offset: 7 tcr: remove/part copy/part ligne (4 + offset) (2 + offset) SO far, it doesn't work ??? >> I get the same results here. Is the result wrong for both of them?
>> ligne: "1234567890ABCDEF"
== "1234567890ABCDEF"
>> offset: 7
== 7
>> tcr: remove/part copy/part ligne (4 + offset) (2 + offset)
== "0A"
>> tcr: remove/part copy/part ligne 11 9
== "0A" --Gregg

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted