VisualBASIC/PowerBASIC style alias command
-
- New User
- Posts: 7
- Joined: Tue Feb 20, 2007 2:19 pm
VisualBASIC/PowerBASIC style alias command
"Alias" would be a great feature, it's the only feature that is keeping me
from buying the full version of PureBASIC, instead of PowerBASIC.
"Alias" aliases the executable name of a function, particularly useful
for DLLs.
I would like to see this command in upcoming version of PureBASIC.
from buying the full version of PureBASIC, instead of PowerBASIC.
"Alias" aliases the executable name of a function, particularly useful
for DLLs.
I would like to see this command in upcoming version of PureBASIC.
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
it is possible to "ALIAS" commands by defining Macros....
Code: Select all
Macro Output( Expression )
Debug Expression
EndMacro
Output("test")
a = 567
Output(a)
oh... and have a nice day.
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
erm yes.. so what?
it's just what can be done with a macro...
or do I misunderstand something?
same is possible with DLL-Calls...
it's just what can be done with a macro...
or do I misunderstand something?
Code: Select all
Macro MyRGB(r,g,b)
RGB(r,g,b)
EndMacro
Macro NewWindow(Nr,x,y,width,height,title,flags = #PB_Window_SystemMenu)
OpenWindow(Nr,x,y,width,height,title,flags)
EndMacro
Macro StartScreen(width,height,depth,title)
OpenScreen(width,height,depth,title)
EndMacro
oh... and have a nice day.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
If you have an import library for the DLL, I guess you could use the 'As' keyword to simulate 'Alias'.
But using a Macro is also a good idea.
Code: Select all
Import "User32.lib"
FindTheWindow(*ClassName, *WindowName) As "_FindWindowA"
EndImport
Debug FindTheWindow(0, @"jaPBe V3")
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Or for a DLL:
Code: Select all
Prototype EasyRequester(Message.s)
Define MyAlias.EasyRequester
If OpenLibrary(0, "PureBasic.dll")
MyAlias = GetFunction(0, "EasyRequester")
MyAlias("Hello")
CloseLibrary(0)
EndIf
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Yes !ts-soft wrote:Or for a DLL:Code: Select all
Prototype EasyRequester(Message.s) Define MyAlias.EasyRequester If OpenLibrary(0, "PureBasic.dll") MyAlias = GetFunction(0, "EasyRequester") MyAlias("Hello") CloseLibrary(0) EndIf
I forgot the prototypes ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
I thought it was like this:
That's how the alias keyword works in Pascal and it also fits the description given by mr daniel reed. Also it's not possible in PureBasic.
Code: Select all
ProcedureDLL MyFunc() Alias "_CustomDecoration"
EndProcedure
-
- New User
- Posts: 7
- Joined: Tue Feb 20, 2007 2:19 pm
Yes, sorry if I didn't clarify enough. This is exactly what I'm talking about.thought it was like this:
Code:
ProcedureDLL MyFunc() Alias "_CustomDecoration"
EndProcedure
That's how the alias keyword works in Pascal and it also fits the description given by mr daniel reed. Also it's not possible in PureBasic.
I'm needing to alias my functions like so:
?Constructor@@YAXXZ
?Destructor@@YAXXZ
?ReceiveCoreDataPtr@@YAXPAX@Z
ProcedureCDLL ReceiveCorePtr [Alias "?ReceiveCoreDataPtr@@YAXPAX@Z"] (*pCore)
-
- New User
- Posts: 7
- Joined: Tue Feb 20, 2007 2:19 pm
Not in my opinion at all. I beleive that this function would increase the sales of PureBASIC because of the increased ammount of DarkBASIC users who would purchase it to make Third party plugins.Just want to add: don't call it lame if a function is not in PureBasic, and you think it should be in! Fred and the team will decide if a feature request is good enough to be added. Don't come over here with a list off functions that MUST be added because this would make PureBasic a killer app in your opinion.
No, we are not going to change this forum to "Feature Demands and MustDo lists"
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
where did you quote it from?mr daniel reed wrote:Not in my opinion at all. I beleive that this function would increase the sales of PureBASIC because of the increased ammount of DarkBASIC users who would purchase it to make Third party plugins.Just want to add: don't call it lame if a function is not in PureBasic, and you think it should be in! Fred and the team will decide if a feature request is good enough to be added. Don't come over here with a list off functions that MUST be added because this would make PureBasic a killer app in your opinion.
No, we are not going to change this forum to "Feature Demands and MustDo lists"
oh... and have a nice day.
-
- New User
- Posts: 7
- Joined: Tue Feb 20, 2007 2:19 pm