Re: error?

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

Don Phillips <EuNexus at yahoo.com> wrote:

> Actuall no, in Euphoria this is a perfectly valid statement.  The docs
> are a wee bit hard to understand on this point,

See refman_2.htm, 2.2.6 'Slicing of Sequences':
"x[3..2] is also allowed. It evaluates to the length-0 sequence {}."

> but it works out like this:
> slice[ # .. (anything greater than #) ] = a sequence
> slice[ # .. # ] = a sequence length 1
>
> slice[ # .. #-1 ] = a sequence length 0
>
> slice[ # .. (anything less than #-1) ] = error
>
>
> Ok, if
> decimalcount = 1
> (the debug screen says it is 1)
> then shouldn't this line crash?:
>
> resultnum = resultnum[1..decimalcount-1] & "." &
> resultnum[decimalcount..length(resultnum)]
>
> since it is the same as:
> resultnum[1..0]
> ?
>
> Kat

Regards,
   Juergen

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

Search



Quick Links

User menu

Not signed in.

Misc Menu