I would expect the following to return a 1 but apparently I am not understanding.
Jim
AddExtender('ilcjs44i.dll', 0, 'ilcjs64i.dll')
#definesubroutine jsKeyExist(_handle,_Key)
Return Arrinfo(jsKeyPaths(_handle, _key), 1)
#endsubroutine
#DefineSubroutine jsValueGetDefault(_handle,_Key,_Delimiter,_Default)
Message(Arrinfo(jsKeyPaths(_handle, _key), 1),jsValueGetDefault(_handle, _key, _Delimiter,""))
If Arrinfo(jsKeyPaths(_handle, _key), 1) > 0 Then
Return jsValueGet(_handle, _key, _Delimiter)
Else
Message("DEFAULT","")
Return _Default
EndIf
#EndSubroutine
xtxt = `{"returnCode":0,"searchResultsKey":1457977769,"numberOfResults":1,"blockOfResults":[{"numberCopiesTotal":1,"numberCopiesAvailable":0,"numberCopiesReference":0,"numberCopiesReserved":0,"resultsIndex":1,"baseResourceSn":76449,"baseResourceKey":409560567,"title":"Artificial unintelligence : how computers misunderstand the world","edition":"First MIT Press paperback edition","author":"Broussard, Meredith","callNumber":"303.4834 B876","isbn":"9780262537018","hasLocalImage":false,"mediaDescription":"Book","mediaCategory":"Non-Fiction","location":"General Collection","notes":"First published in hardback in 2018.","series":[{"sn":73323,"seriesName":"Cambridge, Massachusetts"},{"sn":268476,"seriesName":"The MIT Press"},{"sn":274366,"seriesName":"Informational works"}],"rating":0,"reviewCount":0,"publisherName":"The MIT Press","publisherPlace":"Cambridge, Massachusetts","publisherYear":"2019","subjects":[{"value1":274365,"value2":"Computer programs - Correctness","sortByIntFirst":false},{"value1":274364,"value2":"Electronic data processing - Social aspects","sortByIntFirst":false},{"value1":58603,"value2":"Errors","sortByIntFirst":false}],"summaryText":"\"In Artificial Unintelligence, Meredith Broussard argues that our collective enthusiasm for applying computer technology to every aspect of life has resulted in a tremendous amount of poorly designed systems. We are so eager to do everything digitally--hiring, driving, paying bills, even choosing romantic partners--that we have stopped demanding that our technology actually work...","readingLists":[],"genre":"Informational works","physicalDesc":"237 pages : illustrations ;23 cm","hasPRC":false,"hasAR":false,"collIconSN":15,"AvailText":"0","AvailColour":"#FF0000"}]}`
jnode = jsParse(xtxt)
If jsValueGet(jnode,"numberOfResults") == 0 Then Return
bib = jsValueGet(jnode,"blockOfResults[0].baseResourceKey")
Message(" BIB",bib)
Message("Bib Key Exist?",jsKeyExist(jnode,"[blockOfResults][0].[baseResourceKey]"))
jsConClose(jnode)
Jim