This is a basic topic in programming and advanced CCX scripters would probably find it boring, but I'm going to cover it anyway :)
A variable is a memory address which store information that a program is using during its operation, and within a script it can be used to store things like calling number, hour, date and the name of a .wav file to be played. CCX supports many variable types, integers, strings and more.
When a variable is defined as a parameter, the system administrator would have the option to define it outside of the script editor. This is an important functionality because it allows the creation of a generic script that can be used in many situations.
Lets look at an example, the following image shows a script that plays a prompt based on a comparison of the current hour with an integer variable called openHour:
When this script is configure to be an application in CCX admin, the screen will look like the following:
As can be seen, the openHour variable is internal to the application and the administrator cant change its value without editing the script.
In the next example, the exact same script is shown but with the variable configured to be a parameter:
This will change the application config screen to look like the following:
As can be seen, the openHour variable is now exposed to the system admin and can be changed from the CCX admin interface for things like holiday schedule (late opening hour) or temporary extended hours (holiday season shopping support). The grayed out 0 is going to be used as the variable initial value unless the check box near the parameter is selected and a different value is entered in the content field.
The following screen capture shows how the non default screen would look like, as can be seen, the application is smart enough to tell us its an integer type of variable.
That's it on this topic, the next post will be based on this post and expand on date and time based parameters and variables.
Hi,
ReplyDeletewhat if I want to change openHour variable through script ?
I tried to, but I cannot change it because this variable is configured as parameter.
Do you know solution for this ?
Hi,
DeleteThe 'set' step should allow you to change the variable's value, making it a parameter only affect its initial value but during script run-time it doesn't affect it.
Have you tried it using that step? how are you verifying/debugging that it doesn't work?