Difference between a method and a function

BlitzMax Forums/BlitzMax Beginners Area/Difference between a method and a function

Well, Global and Function can be placed into a type. There is no real difference between having them in the type and outside of the type. Its just these are sort of associated with a type itself, and not an instance of it. Methods are associated with a specific type because they can use fields of the type without using a handle in the syntax.

popular usage:
Type Car
 Global List:TList=new TList
 Field Speed#

 Method Gas()
  Speed=Speed+1
 End Method

 Function Create:Car(StartingSpeed#)
  local C:car=new car
  c.speed=startingspeed
  list.addlast(c)
  return c
 end function
end type

local c:car=car.create(5)
c.gas(5)