Re: error?

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

--0-1993595551-1035513381=:35387


Actuall no, in Euphoria this is a perfectly valid statement.  The docs are a wee
bit hard to understand on this point, 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






---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
--0-1993595551-1035513381=:35387
Content-Type: text/html; charset=us-ascii

<P>Actuall no, in Euphoria this is a perfectly valid statement.&nbsp; The docs
are a wee bit hard to understand on this point, but it works out like this:
<P>slice[ # .. (anything greater than #) ] = a sequence
<P>slice[ # ..&nbsp;# ] = a sequence length 1</P>
<P>slice[ # ..&nbsp;#-1 ] = a sequence length 0</P>
<P>slice[ # ..&nbsp;(anything less than #-1)&nbsp;] = error</P>
<P>&nbsp;<B><I>Kat &lt;kat at kogeijin.com&gt;</I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px
solid">============ The Euphoria Mailing List ============ <BR><BR>Ok, if
<BR>decimalcount = 1<BR>(the debug screen says it is 1)<BR>then shouldn't this
line crash?:<BR><BR>resultnum = resultnum[1..decimalcount-1] &amp; "." &amp;
<BR>resultnum[decimalcount..length(resultnum)]<BR><BR>since it is the same
as:<BR>resultnum[1..0]
<BR>?<BR><BR>Kat<BR><BR>==^================================================================<BR>This
email was sent to: EuNexus at yahoo.com<BR><BR>EASY UNSUBSCRIBE click here:
http://topica.com/u/?b1dd66.b3deX6.RXVOZXh1<BR>Or send an email to:
EUforum-unsubscribe at topica.com<BR><BR>T O P I C A -- Register now to manage
your
mail!<BR>http://www.topica.com/partner/tag02/register<BR>==^================================================================<BR></BLOCKQUOTE><p><br><hr
size=1>Do you Yahoo!?<br>
<a href="http://webhosting.yahoo.com/ ">Y! Web Hosting</a> - Let the expert host
your web site
--0-1993595551-1035513381=:35387--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu