Re: Newbie Questions

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

> I need to add two sequence segments to make a single sequence (sting), I
> know whot to do it in basic (ugh!).
>
> Test$=A$(1)
> Test$=Test$ + " "
> Test&=Test + A&(2)
>
> How do I do it in Euphoria?

It's really easy!
As you might know, a string is just a sequence of ASCII values in
Euphoria... so all sequence manipulations are allowed with "strings".
Example:
sequence A
sequence B
sequence C

A="Hello World!"
B="Goodbye World!"
C=A&B                   --Now C="Hello World!Goodbye World!"
C=A[1..5] & B[1..7]     --Now C="HelloGoodbye"

You see how simple it is?
If you're a Basic programmer, first think you must do is forget that
a STRING is a special Data Type. In Euphoria there're just ATOMS ans
SEQUENCES. If it's not clear this, please read the "Euphoria
Reference Manual", or ask me about what particulary subject you are
experiencing troubles.

Regards,
  Daniel Berstein
  danielberstein at usa.net
  http://www.geocities.com/SiliconValley/Heights/9316

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

Search



Quick Links

User menu

Not signed in.

Misc Menu