TeleFlow Forums
http://teleflow.org/phpbb/

Substract error
http://teleflow.org/phpbb/viewtopic.php?f=10&t=217
Page 1 of 1

Author:  netscon [ Wed Feb 02, 2005 8:22 pm ]
Post subject: 

Hi, Im trying to substract the last five digits out of a variable (@NUM_SERIE). <br> <br>Im using the math step as follows <br>first im setting (manualy) '@NUM_SERIE' to '3C34567Z98712345' <br>But on the [18] Math step Im not populating the variable (@N_SERIE_CINCO) <br> <br>Any hint? <br>is there a step to get the 5 digits out of a variable but from right to left? <br> <br>thank you <br> <br> <br>Feb 02 20:17:54.29: [106] Set Global Variable <br>Feb 02 20:17:54.29: Setting global variable '@NUM_SERIE' to '3C34567Z98712345' <br>Feb 02 20:17:54.29: [2] FINISH <br>Feb 02 20:17:54.29: Main<==Defaults <br>Feb 02 20:17:54.31: [55] Wait for Call <br>Feb 02 20:17:54.31: WARNING: TIMEOUT '0' evaluates to 0 and is interpreted as no timeout <br>Feb 02 20:17:55.81: Wait for 0 rings and then pickup <br>Feb 02 20:17:57.64: Connection delay: 500 ms <br>Feb 02 20:17:58.14: [106] Run Flowchart <br>Feb 02 20:17:58.14: Flowchart: 'obtenerdatos' <br>Feb 02 20:17:58.14: Main==> <br>obtenerdatos <br>Feb 02 20:17:58.14: [1] START <br>Feb 02 20:17:58.14: [3] Clear TT <br>Feb 02 20:17:58.15: [4] Get TT String <br>Feb 02 20:17:58.15: Setting global variable '@CINCODIGITOS' to '' <br>Feb 02 20:18:02.07: Got: '12345' <br>Feb 02 20:18:02.07: Setting global variable '@CINCODIGITOS' to '12345' <br>Feb 02 20:18:02.07: [7] Beep <br>Feb 02 20:18:02.25: [8] Beep <br>Feb 02 20:18:02.40: [18] Math <br>Feb 02 20:18:02.40: @N_SERIE_CINCO = substr (NUM_SERIE, 12, 5) <br>Feb 02 20:18:02.40: @N_SERIE_CINCO = substr (NUM_SERIE, 12, 5) <br>Feb 02 20:18:02.40: (integer): 5 <br>Feb 02 20:18:02.40: Setting global variable '@N_SERIE_CINCO' to '' <br>Feb 02 20:18:02.40: [9] Compare <br>Feb 02 20:18:02.40: @N_SERIE_CINCO = @CINCODIGITOS? <br>Feb 02 20:18:02.40: (string): = (integer):12345? <br>Feb 02 20:18:02.40: FALSE <br>Feb 02 20:18:02.42: [12] Beep <br>Feb 02 20:18:02.57: [13] Beep

Author:  Chris [ Thu Feb 03, 2005 9:40 am ]
Post subject: 

Here is your best bet: <br> <br>1) Use a Math step to get the length of the @NUM_SERIE variable. (Set radio button to "String length of") <br> <br>2) Use Math to determine the start position of the string to cut from @NUM_SERIE, as follows: The string length from step 1 minus the length of the string to chop, plus 1. (ie. if you know you want to cut 5 characters from @NUM_SERIE, take the length of @NUM_SERIE minus 5 plus 1) So, you might set a variable named @START_POS to hold this value. <br> <br>3) Use Math to copy from @START_POS for the number of characters to copy. Set the radio button to "Copy string from...", and set "Base value" to the string to copy from (@NUM_SERIE), set "Modifying value" to the start position for the string copy (@START_POS), and set the "Number of characters to copy" to 5. <br> <br>For details of all the ways to use the Math step, or for additional help about the Math step, consult the TeleFlow help for this step.

Author:  netscon [ Thu Feb 03, 2005 12:06 pm ]
Post subject: 

ok... thank you very much <br>Its working!

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/