[Gambas-user] idee for class in code?

ron ronstk at ...239...
Mon Feb 9 13:02:53 CET 2004


Maybe a idee from PHP to define a class in the code instead of
a real class file.

mycalc = new class(
	function add(a,b) (
		return a + b
	)
	function substract(a,b) (
		return a - b
	)
)

print mycalc.add(12,34)

The two functions can later be placed in a real class file "CCalculator" and
the code changed to:

mycalc = new CCalculator()

print mycalc.add(12,34)

My 2 Euro cents

Ron





More information about the User mailing list