Actions

Difference between revisions of "%scutc"

From Zenitel Wiki

Line 21: Line 21:
 
  %scutc(0123456789,-11,3) returns 01
 
  %scutc(0123456789,-11,3) returns 01
 
  %scutc(0123456789,11,3) returns empty string
 
  %scutc(0123456789,11,3) returns empty string
 +
 +
  
 
Back to [[Event_Handler#List_of_macros]].
 
Back to [[Event_Handler#List_of_macros]].

Revision as of 15:59, 4 May 2018

AlphaCom icon 300px.png

Event_Handler macro - Extract substring by byte (character) position

Format: %scutc(string,start-pos,lenght)

  • start-pos: bytecount from start of string. negative: count from end of string. Count start from zero!
  • length: number of bytes to extract. Zero=rest of string.

If the specified substring is (partly) outside the input string, the result is silently truncated, and a shorter, but valid string is returned.

Useful for parsing External_Data_Input input.

Example:

%scutc(%edi,4,3) returns 3 characters from the input string, starting from char 5

More Examples:

%scutc(0123456789,2,3) returns 234
%scutc(0123456789,2,0) returns 23456789
%scutc(0123456789,-4,3) returns 678
%scutc(0123456789,-2,3) returns 89
%scutc(0123456789,-11,3) returns 01
%scutc(0123456789,11,3) returns empty string


Back to Event_Handler#List_of_macros.