Ver Mensaje Individual
  #2
Antiguo 1 de septiembre de 2021, 14:33
fastpho
El Foro es mi casa
Innovación: Por aportar innovaciones - Issue reason: SQLite + OO Cobol class Concurso: Primer puesto: Ganador/a del Primer puesto en un concurso - Issue reason: Acceso a datos Cobol vía web 
Última Actividad 21.08.2026 18:08
Posts Posts: 365
Likes enviados Enviados: 252
Likes recibidos Recibidos: 243

Hola @Xavier, proba con estas lineas .... que te opinas @Kuk,
Código COBOL:
  1.     CLASS OLE               AS "*OLE"
  2.     CLASS OLE-ARRAY   AS "*OLE-ARRAY"

Código COBOL:
  1. WORKING-STORAGE SECTION.
  2.  01 OServManager    pic x(27) value "com.sun.star.ServiceManager".
  3.  01 OServDesktop     pic x(26) value "com.sun.star.frame.Desktop".
  4.  01 ServManager      object reference OLE.
  5.  01 StarDesktop       object reference OLE.
  6.  01 aDoc                    object reference OLE.
  7.  01 atext                    object reference OLE.
  8.  
  9.  
  10.  01 Group1SafeArray        object reference OLE-ARRAY.
  11.  01 VARIANT-TYPE            PIC S9(9) COMP-5 VALUE 23.
  12.  01 LONG-INT-TYPE          PIC S9(9) COMP-5 VALUE 3.
  13.  01 ARRAY-DIMENSION    PIC S9(9) COMP-5 VALUE 1.
  14.  01 AXIS-1                           PIC S9(9) COMP-5 VALUE 3.
  15.  
  16.  01 celements                    PIC S9(9) COMP-5 VALUE 1.
  17.  01 llbound                         PIC S9(9) COMP-5 VALUE 0.
  18.  
  19.  01 Valor-1                          PIC X(23) value "private:factory/swriter".
  20.  01 Valor-2                          PIC X(10) value "_blank".
  21.  01 Valor-3                          PIC X(1)   value "0".
  22.  
  23.  01 Texto-Pas                     PIC X(10).
  24. *
  25.  01 tagSafeArrayBound is typedef.
  26.       05 celements               pic s9(9) comp-5.
  27.       05 llbound                    pic s9(9) comp-5.
  28.  01 SafeArrayBound   TYPE tagSafeArrayBound.
Código COBOL:
  1.      invoke OLE          "CREATE-OBJECT"        using OServManager  returning ServManager.
  2.      invoke ServManager  "createInstance"       using OServDesktop  returning StarDesktop.
  3.      MOVE 0 TO celements OF SafeArrayBound.
  4.      MOVE 0 TO llbound   OF SafeArrayBound.
  5.      invoke OLE-ARRAY    "NEW"                  using
  6.                       by reference VARIANT-TYPE
  7.                       by reference ARRAY-DIMENSION  
  8.                       by reference SafeArrayBound  
  9.                       returning Group1SafeArray.
  10.  
  11.      invoke StarDesktop  "loadComponentFromURL" using
  12.            by reference  Valor-1
  13.            by reference  Valor-2
  14.            by reference  valor-3
  15.            by reference  Group1SafeArray                  
  16.            returning aDoc.
  17.            
  18.      invoke aDoc "GET-Text" returning aText.
  19.      move "Hola Powercobol" to Texto-Pas .
  20.      invoke aText "SET-String" using Texto-Pas.
Saludos ,,,,
fastpho is offline   Responder Con Cita