Sorry to be a pain, but again in the BMI example for LC 8 there is this
function:
function getBMI pHeight, pWeight
put "http://api.clinicalcalculator.org/bmi?" & "height_in_m=" & pHeight &
"&weight_in_kg=" & pWeight into tURL
put url tURL into tJSON
put JsonImport(tJSON) into tArray
return round(tArray["result"]["value"])
end getBMI
Knowing nothing about JSON, I find this confusing to say the least. I see that
the JsonImport uses a URL to get some value(s) based on parameters incorporated
in the URL, but what am I to make of the ‘return’ statement? I mean what do the
bits in square brackets mean? Where did the names ‘result’ and ‘value’ come
from? How would one know the spec of the result returned by a particular
‘JsonImport’ invocation? Are there libraries of these things, or what? How much
JavaScript will I have to know to use this kind of functionality?
Feeling stupid.
Graham
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode