The TeleFlow Basic Script step is not a VB Script interpreter. It is named "Basic scripts" to distinguish it from the scripts used to document the voice recordings in a system.
<br>
<br>The primary purpose of the Basic Script step is to make it easier to manipulate a lot of TeleFlow variables. If you have 20 variables to initialize at the start of your application, its a lot easier to set them all with a single step instead of placing 20 Set Global or Set Local steps.
<br>
<br>The replace function you want to perform simply is not supported. The are a couple of work arounds you can deploy to get past this. If the data you want to translate comes from a table in a database, you can use whatever functions are available for your database. For example:
<br>
<br>select replace(myfield, "p", "Y") as MyStr from mytable
<br>
<br>Not all databases have a replace function that is available through their ODBC drivers, or you may have data that did not come from a table. In this case, you must write a .TAM to perform the replace for you. Check out both the Parse Step, which will find a sub-string within a string, and the Math step, which will allow you to copy part of a string. This would be a complicated .TAM to write, but once complete, you could use it any time you had to replace.
<br>
<br>This is a brand new step that was recently added to TeleFlow. The help for it will be available in an upcoming patch. In the meantime, here is a very brief rundown of what this step is capable of:
<br>
<br> Assignments @VAR = "value"
<br> Compare IF, THEN, ELSE, =, !=, <>, >, >=, <, <=, AND, OR
<br> Math AND, OR, +, -, *, /, MOD
<br> Parentheses are respected when constructing expressions
<br> FOR loops
<br> GOTO and GOSUB using labels such as MYLABEL:
|