Jump to content


< Back to Forum


 

Read Config File


  • Please log in to reply

#1 ThaoHuynh 10 November 2017 - 02:18 PM

Hi VoiceGuide Team,

 

I would like to get some parameters to use in scripts, so can i create a config file ( content parameters ...)  in another direction and read it to get these parameters in VoiceGuide scripts? 

 

Thank you for your support.



#2 SupportTeam 10 November 2017 - 02:50 PM

You can create a file that contains data in "Result Variable Definition" format and read that in during the script.

 

eg. if a file localinfo.txt contains this text:

 

[branchname]{seaside}[waittime]{20}[supervisortel]{5551234}

 

then you can read it into VoiceGuide using a Run VBScript module and this code:

 

set fso = CreateObject("Scripting.FileSystemObject")
set fileLocalData = fso.OpenTextFile("C:\localinfo.txt")
sEntireFile = fileLocalData.ReadAll
set fileLocalData = Nothing
set fso = Nothing
set vg = CreateObject("vgServices.CommandLink")
vg.Run_ResultReturn $RV_LINEID, sEntireFile
set vg = Nothing

 

and you will then be able to use the following $RVs in your script:

 

$RV[branchname]

$RV[waittime]

$RV[supervisortel]

 

which will have values of: seaside, 20 and 5551234 respectively.

 

more information on above method:

 

http://www.voiceguid...esultreturn.htm

 

http://www.voiceguid...html/modvbs.htm

 

 

 

$RV variables can also be set in VG.IN, in section [Scripts], by setting entry GlobalRV

 

eg:

 

GlobalRV=[branchname]{seaside}[waittime]{20}[supervisortel]{5551234}

 

You can also use a Database Query module to retrieve specific data from databases or Excel files etc.

 

http://www.voiceguid.../moddbquery.htm



#3 ThaoHuynh 10 November 2017 - 08:53 PM

Yeah, it's worked for me. Thank you so so much