|
-
Nov 6th, 2009, 07:03 AM
#1
Thread Starter
Hyperactive Member
an object representation of System ?
is there an object representation of System that i can Extend upon such that the extended method becomes global.
Code:
<Runtime.CompilerServices.Extension()> Public sub globalprocedure(ByVal asystem As ?)
-
Nov 6th, 2009, 08:51 AM
#2
Re: an object representation of System ?
Do you know what System is? It's a namespace. Objects are instances of type. A namespace and a type are two very different things. A namespace cannot be instantiated, and therefore cannot be extended.
-
Nov 6th, 2009, 12:01 PM
#3
Thread Starter
Hyperactive Member
Re: an object representation of System ?
i want to create a function like Mid() Rate() MsgBox() Val() that you can access directly instead of making it a method belonging to a class. is there a way to do it?
btw does these functions all belong to the System Namespace?
-
Nov 6th, 2009, 12:10 PM
#4
Re: an object representation of System ?
1) You shouldn't be using functions like Mid, Rate, MsgBox, or Val because they are VB6 legacy functions. Use the .NET equivalents.
2) If you want to make functions like this, you would place them inside a module.
3)
btw does these functions all belong to the System Namespace?
No, and for questions like this, the easiest way to find out where they are from is by typing in the function in the IDE, right-clicking on it and clicking "Go To Definition", or, press F2 to see the Object Browser and type in the function name and search. You will see that these functions are contained in different modules under the same namespace.
Under the Microsoft.VisualBasic namespace:
MsgBox is apart of the Interaction module.
Rate is apart of the Financial module.
Val is apart of the Conversion module.
Mid is apart of the Strings module.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|