Re: Help Please with numbers

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

Jason Gade wrote:
> Jason Gade wrote:
> > cklester wrote:
> > > This is an argument for ESL's sum() function being able to handle all
> > > types...
> > > sequence r1, r2
> > > integer r3, r4
> > > atom total
> > >    r1 = getText(EditText20)
> > >    r2 = getText(Edittext21)
> > >    r3 = 34
> > >    r4 = 15
> > >    total = sum({r1,r2})
> > >    total += sum({r3,r4})
> 
> Oops, sorry.  I guess that you meant that r1 and r2 are text representations
> of numbers.
>  How would sum know that?

It's gonna hafta be smart about it!

r1 = "123"
r2 = 456
total = sum({r1,r2}) -- can work since element 1 is a sequence, use value()

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu