DTS VBScript help - please??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry about the cross post but M$ apparently does not have a "VBScript sucks"
newsgroup and I know this group is heavily traffic-ed. Can anyone tell me
how to make this script WORK? I have a deadline to meet and the only thing
between me and success is VBScript...

I have tried this in several forms, for amusement I am only posting two
forms that fail. Does anyone understand WTF is happening here? In both
cases the script explodes on the second line of code {the "begin" line} with
a type mismatch; WTF?

Function Main()
if 1 <> 2 then
begin
Main = DTSTransformStat_SkipInsert
else
Main = DTSTransformStat_Ok
end if
End Function

-------- And a second form: -------------

Function Main()
if true then
begin
Main = DTSTransformStat_SkipInsert
else
Main = DTSTransformStat_Ok
end if
End Function
 
Richard said:
Function Main()
if 1 <> 2 then
begin
Main = DTSTransformStat_SkipInsert
else
Main = DTSTransformStat_Ok
end if
End Function

I suspect the problem is the "begin", which is not part of VBScript syntax.
The syntax of the If statement 9from MSDN) is:
If condition Then
[statements]
[ElseIf condition-n Then
[elseifstatements]] . . .
[Else
[elsestatements]]
End If Chris Jobson
 
Back
Top