homph

DotNetCobol.cbl

Nov 4th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 2.93 KB | None | 0 0
  1. identification division.
  2. program-id. DotNetCobol.
  3.  
  4. environment division.
  5. configuration section.
  6. special-names.
  7.     copy "CobolTest1.def".
  8.     copy "netobject.def".
  9.     .
  10.  
  11. input-output section.
  12. file-control.
  13.  
  14. *-----------------------------------------------------------------
  15. data division.
  16. *-----------------------------------------------------------------
  17. file section.
  18.  
  19. *-----------------------------------------------------------------
  20. working-storage section.
  21. *-----------------------------------------------------------------
  22.  
  23. *-----------------------------------------------------------------
  24. *   DotNet
  25. *-----------------------------------------------------------------
  26.  
  27. 77  my-assy-handle-01       USAGE IS HANDLE OF "@CobolTest1.CobolTest1.BasicTypesTest".
  28. 77  my-assy-handle-02       USAGE IS HANDLE OF "@CobolTest1.CobolTest1.ComplexTypesTest".
  29. *-77    my-assy-handle-BaseClass    USAGE IS HANDLE OF "@CobolTest1.CobolTest1.CustomTypes.StructTest" VALUE 0.
  30. 77  my-assy-handle-BaseClass    USAGE HANDLE OF OBJECT VALUE 0.
  31.  
  32. *-"@CobolTest1.CobolTest1.CustomTypes.ClassTest".
  33.  
  34. 77  ws-dotnet-GetDateNow        pic x(050).
  35. 77  ws-dotnet-GetDate       pic x(050).
  36. 77  ws-dotnet-IntAdd        pic 9(005).
  37. 77  ws-dotnet-ToString      pic x(050).
  38.  
  39. 77  ws-dotnet-getdate-value     usage double
  40.                     value 534.
  41.  
  42. 77  ws-parm-string          pic x(050).
  43. 77  ws-parm-int         pic 9(005).
  44. 77  ws-parm-float           usage float.
  45. 77  ws-parm-Double          usage double.
  46. 77  ws-parm-DateTime        usage double.
  47.  
  48. *-----------------------------------------------------------------
  49. procedure division.
  50. *-----------------------------------------------------------------
  51. declaratives.
  52. end declaratives.
  53.  
  54. *-----------------------------------------------------------------
  55. *   Programmstart
  56. *-----------------------------------------------------------------
  57.  
  58. aa-programmstart section.
  59. aa-01.
  60.     create "@CobolTest1"
  61.         namespace   is "CobolTest1",
  62.         class-name  is "BasicTypesTest",
  63.         handle is my-assy-handle-01.
  64.  
  65.     create "@CobolTest1"
  66.         namespace   is "CobolTest1",
  67.         class-name  is "ComplexTypesTest",
  68.         handle is my-assy-handle-02.
  69.  
  70.     modify my-assy-handle-01 "@GetDateNow" () giving ws-dotnet-GetDateNow.
  71.     modify my-assy-handle-01 "@GetDate" (ws-dotnet-getdate-value) giving ws-dotnet-GetDate.
  72.     modify my-assy-handle-01 "@IntAdd" (1,2) giving ws-dotnet-IntAdd.
  73.  
  74.     modify my-assy-handle-02 "@GetStruct"() giving my-assy-handle-BaseClass.
  75.    
  76.     inquire my-assy-handle-BaseClass @String ws-dotnet-ToString.
  77.  
  78.     display message box
  79.         "my-assy-handle (1) " my-assy-handle-01
  80.         x"0A"
  81.         "my-assy-handle (2) " my-assy-handle-02
  82.         x"0A"
  83.         "my-assy-handle-BaseClass (3) " my-assy-handle-BaseClass
  84.         x"0A"
  85.         x"0A"
  86.         x"0A"
  87.         "Resultat:"
  88.         x"0A"
  89.         "@GetDateNow " ws-dotnet-GetDateNow
  90.         x"0A"
  91.         "@GetDate " ws-dotnet-GetDate
  92.         x"0A"
  93.         "@IntAdd " ws-dotnet-IntAdd
  94.         x"0A"
  95.         "@String " ws-dotnet-ToString
  96.     end-display
  97.  
  98.     destroy my-assy-handle-01.
  99.     destroy my-assy-handle-02.
  100.     destroy my-assy-handle-BaseClass.
  101. aa-exit.
  102.     exit.
Advertisement
Add Comment
Please, Sign In to add comment