0

Help with first script.



I'm trying to run thi s script on a 210 but I keep getiing an error:

Sub Main()

roku_system=newRokuSystem()

End Sub


Function newRokuSystem() As Object

sender = CreateObject("roDatagramSender")

sender.SetDestination("10.0.0.198", 21076)
sender.Send("Sender Test")

roku_System=CreateObject("roAssociativeArray")
roku_System.LoadFile=rsLoadFile

roku_system.LoadFile()

return roku_System

End Function

Sub rsLoadFile()

sender.Send("rsLoadFile")

readFile = CreateObject("roReadFile", "playlist.txt")

while readFile.AtEOF() = false

readLine = UCase(readFile.ReadLine())
sender.Send("Read Line")

if left(readLine, 6) = "MASTER" then
sender.Send("Master")

else if left(readLine, 7) = "CONTROL" then
sender.Send("Control")

else if left(readLine, 7) = "RESPOND" then
sender.Send("Respond")

else if left(readLine, 4) = "NAME" then
sender.Send("Name")

endif

end while

End Sub

It gets to the point of actually calling the function an then hits an error. I've been using a demo script as a guide and I can't see where the error is.

I've put the file read part in the main and I know that works.

0 comments

Please sign in to leave a comment.