 |
BCX Console Demonstration Program S131.bas
|
' This sample will not compile with the Pelle's C compiler
' OVERLOADED functions are only available on C++ compilers.
DIM
a AS
string
DIM
b AS
integer
DIM
c AS
double
a =
Foo(
"hello"
," there"
)
: PRINT
a
b =
Foo(
123
)
: PRINT
b
c =
Foo(
7.01
)
: PRINT
c
OVERLOADED
FUNCTION
Foo(
b AS
integer
)
AS
integer
FUNCTION
=
b
END
FUNCTION
OVERLOADED
FUNCTION
Foo(
a AS
string, b AS
string)
AS
string
FUNCTION
=
a &
b
END
FUNCTION
OVERLOADED
FUNCTION
Foo(
b AS
double
)
AS
double
FUNCTION
=
b *
b
END
FUNCTION