Re: Integer() operation on a sequence?

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

Michael Raley wrote:
> 
> 
> Derek Parnell wrote:
> > 
> > Michael Raley wrote:
> > > 
> > > 
> > > not too suprisingly I cannot do this 
> > What were you expecting to achieve? 
> As I stated in the example with integer,
> to apply the test to a slice of elements 
> and return a sequence of True/False values. 
> i.e (1,0,0,1,1,0) 
> > 
> > What I'm trying to say is that you could try out writing your own function
> > first and if that is not ever going to be fast enough for your needs,
> > then you could lobby RDS for a new built-in routine. 
> > 
> Yes I could, but I think the functionality has as much broader merit as 
> current native functions and should at least be mentioned.

My previous reply was incomplete because I pressed the TAB key followed
by the ENTER key, thus causing focus to move the the 'Send Now' button
and sending it. Robert/Junko: Maybe this is a minor GUI issue you can tweak.

Anyhow, back to the thread...

What is the difference between ...

  s = integers({2.4, 1, 0, 3.22, -5})
  for i = 1 to length(s) do
     if s[i] then 
        ...
     end if
  end for

and 

  s = {2.4, 1, 0, 3.22, -5}
  for i = 1 to length(s) do
     if integer(s[i]) then 
        ...
     end if
  end for

 
-- 
Derek Parnell
Melbourne, Australia

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

Search



Quick Links

User menu

Not signed in.

Misc Menu