VoiceGuide IVR Software Main Page
Jump to content

Vb Script Module

Recommended Posts

hi

 

i just want to know how to generate an error in VB Script so that it goes to the failure path

 

tks - Hitesh

Share this post


Link to post

Use the VoiceGuide's COM interface to return the result back to VoiceGuide. If you just want to return "fail" you can use:

 

set vg = CreateObject("VoiceGuide.CommandLink")

vg.Run_ResultReturn $RV_LINEID, "fail"

set vg = Nothing

Share this post


Link to post

i tried it but its giving me an error

 

"ActiveX can't create object "Voiceguide.Commandlink"

 

tks - hitesh

Share this post


Link to post

Which version of VoiceGuide are you using?

 

Only v5.0 onwards supports COM interface. Before that you needed to use a "Result File" to return information to VoiceGuide. Please read the VG Help file's sections on "VB Script module" and "Run Program module" for more information on Result Files..

Share this post


Link to post

the help file is not explaining this concept properly

 

could u pls do that for me

 

tks - Hitesh

Share this post


Link to post

The Result File needs to be called VGRUNRESULT_LineNumber.TXT

 

The syntax for the Result File can be:

 

SUCCESS|FAIL

Result Variable

 

There is sample code provided in the "Run VB Script Module" section of VG Help file:

 

Function WriteResultFile(strResult)

  Const ForReading=1, ForWriting=2, ForAppending=8

  filename = "VGRUNRESULT_$RV_DEVICEID.TXT"

  Set fso = CreateObject("Scripting.FileSystemObject")

  Set ts = fso.OpenTextFile(filename, ForWriting, True)

  ts.WriteLine(strResult)

  ts.Close

  WriteResultFile=0

 

  'always deallocate after use...

  set ts = Nothing

  set fso = Nothing

end function

Share this post


Link to post

where should i place these result files b'coz when i put this function in my script, it gives an error "file not found"

 

and where should i use this function in my script and what value to be passed for the function (value of strResult)

 

tks - Hitesh

Share this post


Link to post

The result files should be placed in the same directory where the script (.VGS file) is located.

 

strResult should be assigned whatever the result file should contain. most of the time that's just "success" or "fail"

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×