Is there a way to provide a default parameter in Visual Cobol like you can in C#?
public void MyString(String passedString = " ")
#VisualCOBOL
#TranslatefomCtovisualcobol
Is there a way to provide a default parameter in Visual Cobol like you can in C#?
public void MyString(String passedString = " ")
Is there a way to provide a default parameter in Visual Cobol like you can in C#?
public void MyString(String passedString = " ")
Yes, this is possible using the 2.2 version of Visual COBOL, and the syntax is quite similar to the C# syntax.
As an example:
class-id a.
method-id main static.
invoke self::MyString("Hello")
invoke self::MyString
end method.
method-id MyString static public.
procedure division using by value passedString as string = " ".
display passedString
end method.
end class.
Is there a way to provide a default parameter in Visual Cobol like you can in C#?
public void MyString(String passedString = " ")
Thanks. I thought I tried that. I must have done something wrong.
Is there a way to provide a default parameter in Visual Cobol like you can in C#?
public void MyString(String passedString = " ")
Thanks. I thought I tried that. I must have done something wrong.
Is there a way to provide a default parameter in Visual Cobol like you can in C#?
public void MyString(String passedString = " ")
Thanks. I thought I tried that. I must have done something wrong.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.