Skip to main content

Is there a way in visual cobol to do the following?

public Boolean CheckIsInt (string passedString, out Int32 returnedInt)

{

     return Int32.TryParse(passedString, out returnedInt);

}


#TranslatefomCtovisualcobol
#VisualCOBOL

Is there a way in visual cobol to do the following?

public Boolean CheckIsInt (string passedString, out Int32 returnedInt)

{

     return Int32.TryParse(passedString, out returnedInt);

}


#TranslatefomCtovisualcobol
#VisualCOBOL

Yes, COBOL can do REFERENCE and OUTPUT parameters, so in this case something like:

method-id CheckIsint.

procedure division using by value passedString as string, output returnedInt as binary-long

                             returning ret as condition-value.

   set ret to binary-long::TryParse(passedString, output returnedInt

end method.