This sample prg works as expected, when compiled using hbmk2 on ubuntu 18.04 64 bits (shows the content of menu.json file)
Using mod_harbour.v2, file(...) test always return false.
why ? someone can confirm this ?
Código: Seleccionar todo
function main()
local hMenu, cKey, cTemp
if File("menu.json")
cTemp := memoread("menu.json")
hMenu := hb_jsondecode(cTemp)
for EACH cKey in hMenu
? cKey["menuName"]
? cKey["menuIcon"]
? cKey["menuAction"]
? replicate("-",20)
next
else
? "menu.json not found"
endif
return NIL
Código: Seleccionar todo
[
{ "menuName" : "Home",
"menuIcon" : "fas fa-home",
"menuAction": "file1.prg",
"menuActive": "true"
},
{ "menuName" : "Dashboard",
"menuIcon" : "fas fa-desktop",
"menuAction": "file2.prg",
"menuActive": "false"
},
{ "menuName" : "Billing",
"menuIcon" : "fas fa-database",
"menuAction": "file3.prg",
"menuActive": "false"
},
{ "menuName" : "Reports",
"menuIcon" : "fas fa-print",
"menuAction": "file4.prg",
"menuActive": "false"
}
]
Manoel