Oxygen Basic
Programming => Example Code => General => Topic started by: Charles Pegge on January 31, 2014, 01:14:59 PM
-
Multi-Let has now implemented (posted about 4.5 hours ago)
http://www.oxygenbasic.org/forum/index.php?topic=749.0
'BY VALUE:
let a=1 'sys
let b=1.0 'double
let c="1" 'string
'BY VARIABLE:
let d=a 'sys
let e=c 'string
'BY TYPE:"
type vector single x,y,z
let v=vector : v.x=2 'vector
let w=v : 'vector w.x=2
'BY FACTORY FUNCTION:
function vcreate(sys n) as vector*
return getmemory n*sizeof vector
end function
let u=vcreate(10) 'vector
'MULTI-LET:"
let a,b,c,d=pi 'double precision pies
-
very nice that new feature.
does it use memory copying after declaration ?
-
Hi Emil,
It depends on the type of Let. Factory functions allocate memory and return a pointer, variables will normally assign by copying to direct local or static memory.
More details later.