I have created a vbscript and trying to use the basic plugin. I have set the variables in my Task for INPUTPAD, INPUTSTR and INPUTLEN.
I am trying to use the script to pad my text fields.
I keep getting an error Parameter requires an express. 'istr' Line 9 col 10 "" which is my LPAD= String... line
Any ideas are appreciated.
VBSCRIPT
Sub Lpad (ByVal istr As String, ByVal padChar As String, ByVal lengthStr As String )
Lpad = String(CInt(lengthStr) - Len(istr),padChar) & istr
End Sub
Sub Main
Dim s As String
Dim l As String
Dim p As String
s = RoboTaskApp.ExpandText("{INPUTSTR}")
l = RoboTaskApp.ExpandText("{INPUTLEN}")
p = RoboTaskApp.ExpandText("{INPUTPAD}")
r = Lpad (s, p, l)
RoboTaskApp.SetUserVariable("NewStr", Str(r))
End Sub
VBSCRIPT Plugin
Re: VBSCRIPT Plugin
Try this script
Pay attetiont that sub is a procedure and can't return any value
Code: Select all
Function Lpad (ByVal istr As String, ByVal padChar As String, ByVal lengthStr As String )
Lpad = String(CInt(lengthStr) - Len(istr),padChar) & istr
End Function
Sub Main
Dim s As String
Dim l As String
Dim p As String
s = RoboTaskApp.ExpandText("{INPUTSTR}")
l = RoboTaskApp.ExpandText("{INPUTLEN}")
p = RoboTaskApp.ExpandText("{INPUTPAD}")
r = Lpad (s, p, l)
RoboTaskApp.SetUserVariable("NewStr", Str(r))
End Sub
Oleg Yershov
Re: VBSCRIPT Plugin
Thank you. I did figure this out.