cobolmicrofocuscobol.net

What is the syntax for invoking a function with named parameters in Visual Cobol?


How do I use named parameters when INVOKEing a function? In this case I am calling a c# static method, i.e.

INVOKE TYPE ClassName::FunctionName(PARAMETER-VALUE-1, PARAMETER-VALUE-2)

Solution

  • invoke type ClassName::Method(param parmName = parmValue, parameter parmName = parmValue)

    Note param or parameter can be used as the keyword. A space can be used instead of a comma separator as well

    e.g:

    invoke type classname::Method(param StringParm = "a String", parameter IntParm = 100)