This might seem real simple but I am I'm building a website with help online but the code is in c#. I'm wondering what the equivalent vb code is? I'm looking for something along the lines of: "Private sub checkNo(string text)" but its giving me errors. Many thanks in advance.
Private void checkNo(string text)
{
}
The Void structure is a specialized type used internally by the . NET Framework and particularly by Visual C# and Visual C++. It represents a return value type for a method that does not return a value. Visual Basic uses a Sub procedure when a value is not returned and a Function procedure when a value is returned.
In VB.NET, the function is a separate group of codes that are used to perform a specific task when the defined function is called in a program. After the execution of a function, control transfer to the main() method for further execution. It returns a value.
private means the method, function, or property is not accessible to outside the class but can be invoke inside the class itself. public means the method, function, or property is accessible to outside the class and can also be invoke inside the class itself.
VB.NET uses Sub
for void
returning functions:
Private Sub checkNo(text as String)
End Sub
For future reference, if you've inherited a VB.NET code base, an online converter will generally handle the basics of C# to VB.NET conversion pretty well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With