frequency34 Report post Posted 08/11/2006 04:30 PM Hey, Lets say this is my script: A client calls in to get details about all the products he has purchased. The products are spoken out using tts one after the other. After each product is spoken out, the user is asked if he would like to get more details about this product or would he like to get information about the next product. The problem is the number of products he had purchased is retrieved from the database and is not fixed. so its like.. Please enter your 5 digit client id. (The user enters the 5 digits.) Next I have the Run Program Module which runs a java program, which executes the following query: "SELECT product_name FROM client WHERE client_id = <The id which was entered>" The results of this are stored in the result file. [Product 1]{ Book} [Product 2]{ Magazine} [Product 3]{ File} So the script goes like.. The following are the products that you have purchased.. Product 1: Book If you would like more information about this product, press 1. To get info about the next product, press 2. on 2: Product 2: Magazine and so on... now, I know a very ugly way to acheive something like this in Java. Is there an easier way to do it in VBS ? Share this post Link to post
SupportTeam Report post Posted 08/12/2006 12:06 AM As part of your returned results you should probably have an RV which stores the number of products returned - that way you could easily check in the playback part of the script whether there is another product still to be played when user presses 2, or if the script should play "There are no more purchased products". The playback loop itself would just use a counter which is incremented using an Evaluate Expression module (for an example see: http://www.voiceguide.com/vghelp/html/modEvalExpr.htm) and that counter would be used as part of the RV to get purchased product details. eg. if the counter is stored in $RV[ourcounter] to get info on what the current product is the expression $RV[Product$RV[ourcounter]] would retrieve the product description. Share this post Link to post
frequency34 Report post Posted 08/18/2006 07:57 PM Hey, the Evaluate Expression module has made things much easier. Thanks for the help. Share this post Link to post