Re: beginner question

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Wednesday 23 January 2002 11:59 pm, you wrote:
>
> To "add to it," as you'd like to do, use append():
> mySeq = append(mySeq, anotherSeq)
>
> You can also use the following:
> mySeq &= anotherSeq
>
> I think. I'm not so sure about that last one.

append() and "&=" give very different results. Try this:
include print.e
sequence s1,s2

s1 = "Cat"
s2 = "Cat"
s1 = append(s1,"Dog")
s2 &= "Dog"

? s1
? s2

You'll see that the first instance - append - results in creating a new 
"subsequence' embedded within the first:   {67,97,116, {68,111,103} }
more or less "Cat{Dog}"
while the second method  -"&=" - results in a concatenating of the two 
strings :  {67,97,116,68,111,103}   or "CatDog".

If you are wanting to create an "array" of strings: i.e. {"Cat","Dog"}, then 
s1 = append({s1},s2) does the job.

Hint: download Gabriel Boehm's print.e include file from the Euphoria 
archives, it lets  you see the contents of these things in plain English.
Regards,
Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu