Subscripts Tutorial
This tutorial demonstrates how to
- create subscripts
- pass script field data to and from them
We will create and use subscripts with the following elements:
- A Screen script step that contains:
- a Label used to prompt the user to enter a value and display the result notification,
- a Validation Textbox used to accept the user entry and return the calculated value,
- a Button that the user clicks to move to the next part of the script.
- A Set Field step that is used to pass the text for the Label to a script variable.
- A Math step that is used to perform the calculation.
- An End Call Transaction step used to end the 'Call Session'.
Although this script is not processing an actual call session, Softdial Scripter™ is call session based, so we need to simulate a call session to run the script.
The project is organised as shown in Fig. 1.
The Start script calls a subscript (MySubscript) which in turn calls a second subscript (MySubscriptSubscript) and terminates the call session with the End Call Transaction step.
The project consists of the following scripts:
- Start (the default script).
- MySubscript which:
- sets up the text for the user prompt Label - "Enter a number :",
- calls MySubscriptSubscript to display the prompt text and get the user input,
- performs the calculation on the user input,
- sets up the text for the user prompt Label - "The square of the number is :",
- calls MySubscriptSubscript to display the prompt text and the result of the calculation.
- MySubscriptSubscript which contains the screen step for the user interface.
Next, follow the tutorial:
4) Editing MySubscriptSubscript