1. Quickie
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Oct 15, 2006
- 566 views
What's this in 2.4-speak?:
msg[$] = msg[$][1..$-1]
Yeah/no, not being funny, just answer the question please. - 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
2. Re: Quickie
- Posted by Al Getz <Xaxo at aol.com> Oct 15, 2006
- 524 views
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. > - 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."
3. Re: Quickie
- Posted by "Greg Haberek" <ghaberek at gmail.com> Oct 16, 2006
- 577 views
> }}} <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
4. Re: Quickie
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Oct 17, 2006
- 548 views
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 ) Thanks, Pete