Subscript out of range Errors

A plugin that allows for end user development of multiple RS232 device control systems.
dwarfer
New Member
New Member
Posts: 47
Joined: Wed Nov 08, 2006 1:58 pm
Contact:

Subscript out of range Errors

Postby dwarfer » Mon Feb 18, 2008 11:47 am

I have setup MLGenericDevice to capture data from a UK (SKY) satalite reciever and have writtern a vbscript to take the output and populate a number of Variables in MLServer. All seems to work well and the Variables are updated.

However I get the following errors in my log

2/18/2008 16:13:01 MLGenericDevice Error Server Error 9(Subscript out of range) @ Line 370 in procedure ProcessCommands of modSharedCode
2/18/2008 16:13:02 MLGenericDevice Error Server Error 9(Subscript out of range: '[number: 1]') @ Line 90 in procedure RunScript of modScripting
2/18/2008 16:14:02 MLGenericDevice Error Server Error 9(Subscript out of range) @ Line 290 in procedure ProcessCommands of modSharedCode
2/18/2008 16:14:02 MLGenericDevice Error Server Error 9(Subscript out of range) @ Line 370 in procedure ProcessCommands of modSharedCode

What do these errors mean?
If my scrip is causing the errors it is still working ok.

Thanks

90CE
Developer
Developer
Posts: 573
Joined: Mon Nov 28, 2005 1:19 am
Location: Waukee, Iowa
Contact:

Postby 90CE » Mon Feb 18, 2008 2:17 pm

Based on the errors, it appears to be related to your script. Can you post what you are using so I can take a look at it?

dwarfer
New Member
New Member
Posts: 47
Joined: Wed Nov 08, 2006 1:58 pm
Contact:

Postby dwarfer » Tue Feb 19, 2008 8:00 am

Thanks 90CE

Here is my script.
I am new to vbscript so don't laugh. Im sure this could be done with a regular expression or something but what the hell


Function ReturnValue()

Dim isskyon
Dim isskyoff
Dim string
Dim string1
Dim string2
Dim string3
Dim string4
Dim string5
Dim string6
Dim SSCN
Dim SSCA
Dim SSDT
Dim SST0
Dim SSN0
Dim SSE0
Dim channel_no
Dim channel_name
Dim time
Dim program_start
Dim program_name
Dim program_description

string = uservar.text

string1 = split(string, "SSCN")
string2 = split(string1(1), "SSCA")
string3 = split(string2(1), "SSDT")
string4 = split(string3(1), "SST0")
string5 = split(string4(1), "SSN0")
string6 = split(string5(1), "SSE0")

SSCN = string2(0)
SSCA = string3(0)
SSDT = string4(0)
SST0 = string5(0)
SSN0 = Left(string6(0),Len(string6(0))-1)
SSE0 = Left(string6(1),Len(string6(1))-2)

channel_no = mid(SSCN, 4)
channel_name = mid(SSCA, 4)
time = mid(SSDT, 4)
program_start = mid(SST0, 4)
program_name = mid(SSN0, 5)
program_description = mid(SSE0, 4)

Output.AddItem "mlservecmd.setvariable|SKY_channel_number~" & channel_no
Output.AddItem "mlservecmd.setvariable|SKY_channel_name~" & channel_name
Output.AddItem "mlservecmd.setvariable|SKY_time~" & time
Output.AddItem "mlservecmd.setvariable|SKY_program_start~" & program_start
Output.AddItem "mlservecmd.setvariable|SKY_program_name~" & program_name
Output.AddItem "mlservecmd.setvariable|SKY_program_description~" & program_description

isskyoff = InStr(string,"SYST0081")
if isskyoff > 0 then Output.AddItem "mlservecmd.setvariable|SKY_state~" & "on"

isskyon = InStr(string,"SYST0080")
if isskyon > 0 then Output.AddItem "mlservecmd.setvariable|SKY_state~" & "off"

ReturnValue = string
End Function


This parses the following output into my various variables

Buffer - 274SSCN010343SSCA015MTV HITSSSDT02512.56pm Tue 19 FebSST001412.00pmSSN0033†Sugababes: Greatest Hits‡SSE0172Keisha, Amelle and Heidi take us through their formidable back catalogue including hits such as Red Dress, Easy, Hole in the Head, Freak Like Me and Push the Button.3c

sky_channel_name=MTV HITS
sky_channel_number=343
sky_program_description=Keisha, Amelle and Heidi take us through their formidable back catalogue including hits such as Red Dress, Easy, Hole in the Head, Freak Like Me and Push the Button.
sky_program_name=Sugababes: Greatest Hits
sky_program_start=12.00pm
sky_state=on
sky_time=12.57pm Tue 19 Feb

It seems to work ok I just get all them errors.


Return to “MLGenericDevice”

Who is online

Users browsing this forum: No registered users and 1 guest