BlitzCoder Essentials
•
Home Page
•
About BlitzCoder
•
Contributors
•
Terms of Use
•
Email Us
Main Areas
•
BlitzCoder Chat
•
Discussions
•
Articles/Tutorials
•
Code Database
•
Link Database
•
Showcase Area
•
Worklogs
•
Competitions
Special Areas
•
Undocumented
Other Blitz Sites
•
Blitz Basic Home
•
Blitz Showcase
•
BlitzPlay Library
Forum Login
Username:
Password:
•
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"Function Overloading"
, by thechange
Blitz supports a simple version of function overloading.
Code
;------------------------------------------------------------------------------- ; You can overlap all of Blitz' existing functions ; with your own function *and* variable names. Function Text ( msg$ , x , y ) Locate x , y Write msg End Function ; So basically you can rewrite any command not being a keyword/reserved word. Const Plot = 0 Const Line = 1 Const Rect = 2 Const Oval = 3 ; If you use the same name for variables, ; they can coexist with the functions, ; even though their color coding is different in the IDE. Graphics = Line Select Graphics Case Plot Case Line Case Rect Case Oval End Select ; Actually this is just like being able to have ; the exact same name for your own ; functions, variables and even types and fields. Type Struct Field Struct.Struct End Type Global Struct.Struct Function Struct.Struct ( Struct.Struct ) Local Head.Struct Head = New Struct Head\Struct = Struct Return Head End Function ; Be careful ;) ;-------------------------------------------------------------------------------
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations