return.bmx 458 B

1234567891011121314151617
  1. Rem
  2. Return exits a BlitzMax function or method with an optional value.
  3. The type of return value is dictated by the type of the function.
  4. End Rem
  5. Function CrossProduct#(x0#,y0#,z0#,x1#,y1#,z1#)
  6. Return x0*x1+y0*y1+z0*z1
  7. End Function
  8. Print "(0,1,2)x(2,3,4)="+CrossProduct(0,1,2,2,3,4)
  9. Function LongRand:long()
  10. Return (rand($80000000,$7fffffff) shl 32)|(rand($80000000,$7fffffff))
  11. End Function
  12. Print "LongRand()="+LongRand()
  13. Print "LongRand()="+LongRand()