I'm a high school teacher and I just worked through the BMI Calculator interactive tutorial but I'm having a problem. In the stack script I have the following code. When I go into the run mode, enter a height and weight, then click Calculate, I get the following error.
System info:stack "BMI Calculator": execution error at line 7 (LCB Error in file json.lcb at line 65: syntax error: 1:0 unexpected end of input)
2012 iMac, Mac OS 10.14
LiveCode Community Plus 9.0.3
Any help is appreciated!
P.S. I replaced the period in the URL because the forum gave me the message "You can’t post image, email or url links. Please remove clinicalcalculator<dot>org". Even though I checked the "Do not automatically parse URLs" option
Code: Select all
function getBMI pHeight, pWeight
put "http://api.clinicalcalculator<dot>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