Re: Hints & Tips

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

I find these more elegant to read and code,
thus, they have become staples in my toolbox:

function IsSame(object first,object second)
return compare(first,second) = 0
end function

function IsNotSame(object first,object second)
return not ( compare(first,second)=0 )
end function
=================

a relatively accurate, machine independent
routine for waiting. accepts fractional seconds
as well...
use: Delay(10)  waits 10 seconds
     Delay(0.2) waits 2 tenths of a second

procedure Delay(atom seconds)
--assumes tick_rate() is default
atom now
  now = time()
  while (time() - now) < seconds do
  end while
end procedure

example use:
procedure Beep()
--goes "beep" in an ever so pleasant way, informing you
--(most likely) that you just screwed up :)
  sound(500) Delay(0.2) sound(0)
end procedure
========================

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

Search



Quick Links

User menu

Not signed in.

Misc Menu