Ver Mensaje Individual
  #16
Antiguo 14 de junio de 2022, 17:26
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 @Mane9mb, te paso un ejemplo en visual basic , no es muy dificil pasarlo a cobol
usando el control ocx de chilkat
Código VB:
  1. Dim jArray As New ChilkatJsonArray
  2. success = jArray.AddObjectAt(0)
  3. Dim json As ChilkatJsonObject
  4. Set json = jArray.ObjectAt(0)
  5.  
  6. success = json.UpdateString("groupId","")
  7. success = json.UpdateString("sku","")
  8. success = json.UpdateString("title","")
  9. success = json.UpdateString("barcode","")
  10. success = json.UpdateString("category","")
  11. success = json.UpdateString("description","")
  12. success = json.UpdateString("images[0]","url1")
  13. success = json.UpdateString("images[1]","url...")
  14. success = json.UpdateString("isbn","")
  15. success = json.UpdateString("link","")
  16. success = json.UpdateString("linkLomadee","")
  17. success = json.UpdateString("prices[0].type","")
  18. success = json.UpdateNumber("prices[0].price","0")
  19. success = json.UpdateNumber("prices[0].priceLomadee","0")
  20. success = json.UpdateNumber("prices[0].priceCpa","0")
  21. success = json.UpdateNumber("prices[0].installment","0")
  22. success = json.UpdateNumber("prices[0].installmentValue","0")
  23. success = json.UpdateString("productAttributes.""Atributo 1""","Valor 1")
  24. success = json.UpdateString("productAttributes.""Atributo ...""","Valor ...")
  25. success = json.UpdateString("technicalSpecification.""Especificação 1""","Valor")
  26. success = json.UpdateString("technicalSpecification.""Especificação ...""","Valor ...")
  27. success = json.UpdateNumber("quantity","0")
  28. success = json.UpdateNumber("sizeHeight","0")
  29. success = json.UpdateNumber("sizeLength","0")
  30. success = json.UpdateNumber("sizeWidth","0")
  31. success = json.UpdateNumber("weightValue","0")
  32. success = json.UpdateNumber("declaredPrice","0")
  33. success = json.UpdateNumber("handlingTimeDays","0")
  34. success = json.UpdateBool("marketplace",0)
  35. success = json.UpdateString("marketplaceName","")
  36.  
  37. jArray.EmitCompact = 0
  38. Debug.Print jArray.Emit()
  39.  
  40. ' The output of this program is:
  41.  
  42. ' [
  43. '   {
  44. '     "groupId": "",
  45. '     "sku": "",
  46. '     "title": "",
  47. '     "barcode": "",
  48. '     "category": "",
  49. '     "description": "",
  50. '     "images": [
  51. '       "url1",
  52. '       "url..."
  53. '     ],
  54. '     "isbn": "",
  55. '     "link": "",
  56. '     "linkLomadee": "",
  57. '     "prices": [
  58. '       {
  59. '         "type": "",
  60. '         "price": 0,
  61. '         "priceLomadee": 0,
  62. '         "priceCpa": 0,
  63. '         "installment": 0,
  64. '         "installmentValue": 0
  65. '       }
  66. '     ],
  67. '     "productAttributes": {
  68. '       "Atributo 1": "Valor 1",
  69. '       "Atributo ...": "Valor ..."
  70. '     },
  71. '     "technicalSpecification": {
  72. '       "Especificação 1": "Valor",
  73. '       "Especificação ...": "Valor ..."
  74. '     },
  75. '     "quantity": 0,
  76. '     "sizeHeight": 0,
  77. '     "sizeLength": 0,
  78. '     "sizeWidth": 0,
  79. '     "weightValue": 0,
  80. '     "declaredPrice": 0,
  81. '     "handlingTimeDays": 0,
  82. '     "marketplace": false,
  83. '     "marketplaceName": ""
  84. '   }
  85. ' ]
Saludos ....
fastpho is offline   Responder Con Cita