What does Alias identifier do ?

BlitzMax Forums/BlitzMax Programming/What does Alias identifier do ?

skn3(Posted 2005) [#1]
Was just cheaking the docs and noticed Alias. Any info on this identifier ?


Perturbatio(Posted 2005) [#2]
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.


Perturbatio(Posted 2005) [#3]
It appears to allow you to create an Alias for a function.
Alias g:fdjsklfdkjsljkg

g()

Function fdjsklfdkjsljkg()
	Print "here"
End Function



skn3(Posted 2005) [#4]
Interesting, that could come in handy.

If you are looking for it in the docs, goto language references > identifiers.


N(Posted 2005) [#5]
Well, proceed with the confusion!


Bot Builder(Posted 2005) [#6]
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.


Perturbatio(Posted 2005) [#7]
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.


StuC(Posted 2005) [#8]
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


Sarge(Posted 2005) [#9]
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