I'm trying to get the function to pass back an array, but I keep getting errors with this code (Type Mismatch or Subscript Out Of Range). I've tried it several different ways. I know VBScript syntax is a little different, I'm not sure what I'm missing with this. I guess you don't have to set the Function as a Variant with VBScript?
Dim graphicCode(2)
strGraphic = Request.Form("graphic")
graphicCode() = getGraphicCode(strGraphic)
Function getGraphicCode(strGraphic)
Dim graphicCode(2)
Do while x < Len(strGraphic)
if Mid(strGraphic,b,1) = "-" then
graphicCode(1) = Mid(strGraphic,1,b-1)
graphicCode(2)= Mid(strGraphic,b+1,Len(strGraphic))
x = Len(strGraphic) + 1
Else
b = b + 1
End if
x = x + 1
Loop
getGraphicCode = graphicCode()
Dim graphicCode(2)
strGraphic = Request.Form("graphic")
graphicCode() = getGraphicCode(strGraphic)
Function getGraphicCode(strGraphic)
Dim graphicCode(2)
Do while x < Len(strGraphic)
if Mid(strGraphic,b,1) = "-" then
graphicCode(1) = Mid(strGraphic,1,b-1)
graphicCode(2)= Mid(strGraphic,b+1,Len(strGraphic))
x = Len(strGraphic) + 1
Else
b = b + 1
End if
x = x + 1
Loop
getGraphicCode = graphicCode()