What does Alias identifier do ?
BlitzMax Forums/BlitzMax Programming/What does Alias identifier do ?
| ||
Was just cheaking the docs and noticed Alias. Any info on this identifier ? |
| ||
It's not in my docs. *EDIT* However Alias appears to accept an identifier, but not one that is already predefined and you can't seem to affect that identifier. This compiles: Alias a *EDIT* I'm guessing it's a C/C++ command. |
| ||
It appears to allow you to create an Alias for a function.Alias g:fdjsklfdkjsljkg g() Function fdjsklfdkjsljkg() Print "here" End Function |
| ||
Interesting, that could come in handy. If you are looking for it in the docs, goto language references > identifiers. |
| ||
Well, proceed with the confusion! |
| ||
Seems pretty useless to me... unless you want to be odd and make a bunch of aliases for each function so that the user doesn't even have to check the command names most of the time - just guess. But that would get a bit bloated and you wouldn't be able to read others' code as easily. |
| ||
It does seem pretty useless to me too since you can use function pointers with much more flexibility. I can see one use in that you can Alias ReallyLongFunctionNames to something more simple. |
| ||
Interesting... Alias is not a C++ feature - sounds more like an OS function used in command shells, to reference an 'object' via a different name - usally to shorten it. Not sure how it applies to a programming languange, but by simply having the feature, I'm sure we will end up seeing some creative uses for it :) Unix has had it forever, and it has been introduced into the new Microsoft shell. Cheers, Stu |
| ||
Well "Alias" was used in VisualBasic for example:Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" ( ByVal hwnd As Long, _ ByVal nIndex As Long, ByVal dwNewLong As Long) As Long But i cant seem to get alias to work like this in BlitzMax |