Topic Options
#31421 - 07/21/09 10:23 AM Substring in set job info and variable
Alain B Offline
OL Guru

Registered: 09/30/08
Posts: 101
Loc: Montreal
Hi in the setjob info and variable is it possible to do a substring on the value field

ex:
{customeraction} = 'E|adress@domain.com'
{cusaction} = substring({customeraction},1,1}
{cusemail} = substring({customeraction},3}

Description of subtring in this example :
substring(field,startpos,length)

{cusaction} = substring({customeraction},1,1}
extract 1 character starting at position 1


{cusemail} = substring({customeraction},3}
extract all character starting at pos 3

Top
#31422 - 07/21/09 10:41 AM Re: Substring in set job info and variable
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Alain,

Unfortunately, there is no "substring" commands usable in Watch. You could, however, use a vbscript to set the variables, and use vb's own commands(such as "mid") to get your substring.

A sample line of code you could use in a Run Script:

Code:
watch.setvariable "cusaction", mid(watch.getvariable("customeraction"),1,1)
This will set "cusaction" to the first character of "customeraction".

Hope this helps.

Regards,
Rapha

Top
#31423 - 07/21/09 11:19 AM Re: Substring in set job info and variable
Alain B Offline
OL Guru

Registered: 09/30/08
Posts: 101
Loc: Montreal
Ok thanks we will try to find a other way, the only script we use are external script and unfortunately they return only one variable.

Top