BCX Console Demonstration Program s131.bas

 ?  "This sample will not compile with the Pelles C compiler."
 ?  "OVERLOADED functions are only available on LCC-WIN32 and C++ compilers."
 ?  "To compile the full demo, remove $COMMENT directives below." 

 $COMMENT
 
 
 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
 
 
 $COMMENT
 
 

Result:


 hello there
 123
 49.1401