Z
zacks
I am trying to write a VBScript that will be executed by a VB.NET 2005
program using Microsoft's Scripting Control. I have gotten a few simple
scripts to work but I am having problems on one. I need to parse a
character string value and pick out the pieces that are delimited by
periods. For example, the input value may be:
58000.44.51.
and I want to parse out the 58000 and return that value. I wrote the
following script:
Dim MyString As String
MyString = ScriptProcessor.Fields.Item(0)
ScriptProcessor.ReturnValue = MyString.Substring(0,
MyString.IndexOf(".") - 1)
But when VB tried to execute the script, I get the runtime error
"Expecting end of statement". After some experimentation, it appears
that the "As String" datatype declaration is what is causing the error.
So how do I declare local string variables?
program using Microsoft's Scripting Control. I have gotten a few simple
scripts to work but I am having problems on one. I need to parse a
character string value and pick out the pieces that are delimited by
periods. For example, the input value may be:
58000.44.51.
and I want to parse out the 58000 and return that value. I wrote the
following script:
Dim MyString As String
MyString = ScriptProcessor.Fields.Item(0)
ScriptProcessor.ReturnValue = MyString.Substring(0,
MyString.IndexOf(".") - 1)
But when VB tried to execute the script, I get the runtime error
"Expecting end of statement". After some experimentation, it appears
that the "As String" datatype declaration is what is causing the error.
So how do I declare local string variables?