Hola colegas, estoy probando las rutinas del maestro Irwin, pero se nota que me falta mucho aun con el tema de las apirest, json, etc
tengo el siguiente string en una variable que pude hacer q me devuelva la pagina con las apirest, con esa variable quiero saber si con la libreria de irwin puedo pasarla a un cursor.
Al ejecutar este codigo me da error , interpreto como que esta demas el corchete, pero lo probe tb sacandolo
&&// Create Object
clear
Public Rest,lojason
&& Set Procedure To \visual\apirest\VFPRestClient.prg Additive
Rest = NewObject("Rest", "h:\visual\apirest\VFPRestClient.prg")
DO h:\visual\apirest\
jsonfox.app SET PRINTER off
SET PRINTER TO
SET PRINTER TO c:\visual\apirest.txt
SET PRINTER ON
TEXT TO cTexto NOSHOW
[{"Id":9734,"Ids":"#0000##9734#","ItemType":4,"Na
me":"prueba","Description":"tyrt","Index":"prueba"
,"Indexes":"prueba","Text":null,"Keywords":"yutr",
"SiteId":0,"CreatorId":9,"ModificatorId":9,"Code":
"767657657676","CreationDate":"2020-06-28T14:58:
12.383","ModificationDate":"2020-06-28T14:58:12.3
83","PublishingStatus":0,"AllPublishingStatus":nul
l,"DefaultPrice":6.00,"DefaultStock":1,"ReferenceI
d":null,"DiscountMultiplier":null,"ForSale":false,
"Vigency":false,"VigencyFrom":"2020-06-28T14:58:
12.6","VigencyTo":"2020-06-28T14:58:12.6","MetaD
escription":"tyrt","MetaTitle":"prueba","MetaKeywo
rds":"yutr","MetaLang":"","MetaAuthor":"","Author"
:"","AutoMeta":true,"ParentId":0,"Weight":31,"Weig
hts":"0031\u0000","Brand":"","UseRefPictures":fals
e,"Manufacturer":null,"Depth":0,"IsRepository":fal
se,"Tags":null,"CustomDate":"2020-06-28T14:58:12.
6","IncludeOnRss":true,"IncludeOnSitemap":true,"C
urrencyId":null,"PriceListId":0,"AppendControls":n
ull,"ContentOrder":0,"ContentDisplay":0,"ContentSo
rt":true,"ContentRecsPerPage":0,"ItemFilters":null
,"PriceMode":0,"FilterGroup":0,"Sync":true,"Discou
nt":0.00,"DiscountMode":0,"Currency":null,"Images"
:[],"ExtendedWarranty":[],"Additionals":[],"Filter
s":[],"Properties":[],"DesignProperties":[],"Defau
ltPrices":null,"Callout":[],"DefaultMinStock":0,"B
oxWeight":null,"BoxHeight":null,"BoxWidth":null,"B
oxLength":null,"WeightUnits":null,"LengthUnits":nu
ll,"DefaultOfferPrice":6.00,"FreeShipping":false,"
PriceMultiplier":1,"UnitsMultiplier":1,"Taxes":nul
l,"IsCombo":false,"ItemDiscounts":[],"SyncPrice":f
alse},{"Id":9736,"Ids":"#0000##9736#","ItemType":4
,"Name":"prueba2","Description":"prueba
interface","Index":"prueba2","Indexes":"prueba2","
Text":null,"Keywords":" prueba2
05606001","SiteId":0,"CreatorId":9,"ModificatorId"
:9,"Code":"05606001","CreationDate":"2020-07-20T
13:31:50.983","ModificationDate":"2020-07-20T13:3
1:50.983","PublishingStatus":0,"AllPublishingStatu
s":null,"DefaultPrice":0.00,"DefaultStock":-1,"Ref
erenceId":null,"DiscountMultiplier":null,"ForSale"
:true,"Vigency":false,"VigencyFrom":"2020-07-20T1
3:31:51.233","VigencyTo":"2020-07-20T13:31:51.23
3","MetaDescription":"prueba
interface","MetaTitle":"prueba2","MetaKeywords":""
,"MetaLang":"","MetaAuthor":"","Author":"","AutoMe
ta":true,"ParentId":0,"Weight":32,"Weights":"0032\
u0000","Brand":"","UseRefPictures":false,"Manufact
urer":null,"Depth":0,"IsRepository":false,"Tags":n
ull,"CustomDate":"2020-07-20T13:31:51.233","Inclu
deOnRss":true,"IncludeOnSitemap":true,"CurrencyI
d":null,"PriceListId":0,"AppendControls":null,"Con
tentOrder":0,"ContentDisplay":0,"ContentSort":true
,"ContentRecsPerPage":0,"ItemFilters":null,"PriceM
ode":0,"FilterGroup":0,"Sync":true,"Discount":0.00
,"DiscountMode":0,"Currency":null,"Images":[],"Ext
endedWarranty":[],"Additionals":[],"Filters":[],"P
roperties":[],"DesignProperties":[],"DefaultPrices
":null,"Callout":[],"DefaultMinStock":0,"BoxWeight
":null,"BoxHeight":null,"BoxWidth":null,"BoxLength
":null,"WeightUnits":null,"LengthUnits":null,"Defa
ultOfferPrice":0.00,"FreeShipping":false,"PriceMul
tiplier":1,"UnitsMultiplier":1,"Taxes":null,"IsCom
bo":false,"ItemDiscounts":[],"SyncPrice":false}]
ENDTEXT
obj = _Screen.Json.Parse(cTexto)
* Don't forget check the LastErrorText
If _Screen.Json.lError
MessageBox(_Screen.Json.LastErrorText, 48, "Something went wrong")
Return
EndIf
?_Screen.Json.Stringify(cTexto)
* Don't forget check the LastErrorText
If _Screen.Json.lError
MessageBox(_Screen.Json.LastErrorText, 48, "Something went wrong")
Return
EndIf
SET PRINT off
SET PRINTER TO
Release Rest