Results 1 to 3 of 3

Thread: NetRemote.GetVariable

  1. #1

    Default NetRemote.GetVariable

    Hi,

    I'm having a problem to read a NR variable in LUA. If I look in the NR Variable Inspector I can see there is data in the variable but the LUA code returns nil, please see code below.
    I could, somehow, check to see what type of data that was in the variable and that returned String.

    Any comment would be appriciated


    Code:
    function UpdateWeather()
    local wItem
    local wIcon
    local wCount
    local wItemlist
    local wTemp
    local test1
    wItem = 1
    wCount = 1
    print("Update ongoing...")
    	repeat
    	wItemlist = NetRemote.GetVariable("MEDIASERVER\RSS\Yahoo Weather\ItemList.Values_1_Description")
    	wCount = string.find (wItemlist, '.', 1)
    	wIcon = string.sub(wItemlist, 1, wCount)
    	NetRemote.SetVariable('w'..wItem, wIcon)
    	wItem = wItem + 1
    	print (wItemlist)
    	until wItem ==25
    print ("Updated")
    end

  2. #2
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    You either need to enclose the variable name in [[ ]] style quotes or double up the backslashes i.e.

    Code:
    wItemlist = NetRemote.GetVariable([[MEDIASERVER\RSS\Yahoo Weather\ItemList.Values_1_Description]])
    or

    Code:
    wItemlist = NetRemote.GetVariable("MEDIASERVER\\RSS\\Yahoo Weather\\ItemList.Values_1_Description")
    --Rob

  3. #3

    Default

    Thanks, works perfectly now. It's the small things.......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •