PDA

View Full Version : Lua code OK in NR but not G4



dsmes
September 14th, 2006, 07:25 PM
I'm using a modified version of danward79's weather script which starts out like-
function Getweather()
CC = luacom.CreateObject("Msxml2.DOMDocument")
CC.async = 0
CC:load ("http://xoap.weather.com/weather/local/"..Location.."?cc=*&prod=xoap&par="..PartnerID.."&key="..LicenseKey)
This works fine if run as NetRemote Lua code but if I run it from Girder, it errors on the "CC.async = 0" line saying "attempt to index global `CC' (a nil value)". What do I need to do differently for this to work in Girder?

dsmes
September 14th, 2006, 07:55 PM
Never mind... I was calling the function from a seperate thread and it won't work that way. If I call it directly, it works fine.