1. Quickie

What's this in 2.4-speak?:

msg[$] = msg[$][1..$-1]


Yeah/no, not being funny, just answer the question please. blink
- as in how to code most readable w/o $.
my -ve idx: msg[-1] = msg[-1][1..-2] is no easier to back-port.

Regards,
Pete

new topic     » topic index » view message » categorize

2. Re: Quickie

Pete Lomax wrote:
> 
> What's this in 2.4-speak?:
> 
> }}}
<eucode>
>             msg[$] = msg[$][1..$-1]
> </eucode>
{{{

> 
> Yeah/no, not being funny, just answer the question please. blink
> - as in how to code most readable w/o $.
> my -ve idx: msg[-1] = msg[-1][1..-2] is no easier to back-port.
> 
> Regards,
> Pete
> 
> 

Hi there,

Just one technique...

--msg[$]=msg[$][1..$-1]

integer void

void=length(msg)
msg[void]=msg[void][1..length(msg[void])-1]



Take care,
Al

E boa sorte com sua programacao Euphoria!


My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

new topic     » goto parent     » topic index » view message » categorize

3. Re: Quickie

> }}}
<eucode>
>            msg[$] = msg[$][1..$-1]
> </eucode>
{{{


msg[ length(msg) ] = msg[ length(msg) ][ 1.. length(msg[length(msg)])-1 ]

-- OR ----------

integer len1, len2

    len1 = length( msg )
    len2 = length( msg[len1] )
    msg[len1] = msg[len1][1..len2-1]

-- OR ----------

sequence temp

    temp = msg[length(msg)]
    temp = temp[1..length(temp)-1]
    msg[length(msg)] = temp


new topic     » goto parent     » topic index » view message » categorize

4. Re: Quickie

On Mon, 16 Oct 2006 08:16:40 -0400, Greg Haberek <ghaberek at gmail.com>
wrote:

>-- OR ----------
>
>sequence temp
>
>    temp = msg[length(msg)]
>    temp = temp[1..length(temp)-1]
>    msg[length(msg)] = temp

Ah! You just hit the nail on the head.
I knew it was something trivial like that, just couldn't visualise it.
- Meanwhile I went with option 2 (len1/len2), tho I shall definitely
use this, if nothing else than for speed trials blink)

Thanks,
Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu