CodeBlue
CodeBlue

Reputation: 15399

Does VB6 have a way of specifying function aliases?

Is there a way to specify an alias for a function in VB6?

For eg. I have the following function

 Public Sub printCommonString(CommonString() As Byte)
 ...

I call this function like this -

 printCommonString commonString

Instead of calling the function this way, I want to use a shorter name like

pCS commonString

So pCS is an alias for printCommonString. Is there a way to write such an alias?

Upvotes: 1

Views: 986

Answers (2)

JackoBongo
JackoBongo

Reputation: 87

As far as I know, the only kind of alias you can use in VB6 are the ones from declaring Function from DLL. E.g.

Declare Function Dostf Lib "stuff.dll" Alias "DoStuff" (ByVal id As Integer, ByRef msg As Any, ByVal blen As Integer) As Integer)

Where DoStuff is the function name in the library and Dostf is the function name within the vb code.

Upvotes: 1

UnhandledExcepSean
UnhandledExcepSean

Reputation: 12804

There is no way to alias in VB6 as far as I've ever seen. Here might be an option if you aren't able to rename the method.What about making a method that simply wraps printCommonString?

Public Sub pCS(ByRef CommonString() As Byte)
   printCommonString CommonString
End Sub

Upvotes: 4

Related Questions