Oxygen Basic

Programming => Problems & Solutions => Topic started by: Charles Pegge on July 10, 2012, 12:31:00 AM

Title: Return division problem
Post by: Charles Pegge on July 10, 2012, 12:31:00 AM
I found a bug which shows up when using unprototyped procedures:

return (te-ts) / freq

Due to an uncleared flag,This affects the return type of the next function - turning it into a float.

Code: OxygenBasic
  1.   function TimeLapse(quad *ts,*te) as double
  2.   return (te-ts)/freq 'SECONDS
  3.  end function
  4.   '
  5. '...
  6.  
  7.   function ShiftKey() as sys
  8.   return 0xffff and GetAsyncKeyState(VK_SHIFT)
  9.   end function
  10.  

Charles

Problem fixed below: