Log In
Developer Network
Technologies
Join the Network
Member Services
Events & Community
Voice Gateway API (VGAPI) Developer Center
Overview
Documentation
Community
Testing
Message Boards Home
Recent Posts
Statistics
Answer
(
Unmark
)
Mark as an Answer
« Back to TCL-API
'string list' not working right
Threads [
Previous
|
Next
]
Jason Schwefel
Posts:
5
Join Date:
8/1/09
Recent Posts
'string list' not working right
string index
Answer
2/16/11 3:58 PM
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Code snippit:
#String Index is 0 based
set next_tnt_digit_pos "0"
set tnt_code_caught "0"
set next_redir_digit ""
set next_redir_digit_pos "1"
set redir_number ""
puts "############################## '$next_tnt_digit_pos' ######"
puts [string is integer -strict $next_tnt_digit_pos]
#Pull the first digit of the TNT code
set next_tnt_digit [string index tnt_code next_tnt_digit_pos]
When I run the above script, I get the following:
Feb 16 08:55:35.712 CST: //49234//TCL :/tcl_PutsObjCmd: ############################## '0' ######
Feb 16 08:55:35.712 CST:
Feb 16 08:55:35.712 CST: //49234//TCL :/tcl_PutsObjCmd: 1
Feb 16 08:55:35.712 CST:
Feb 16 08:55:35.712 CST: //49234//AFW_:/AFW_FSM_Drive: Tcl_Eval to drive FSM inside Tcl modulespace. code=1 code=ERROR
Feb 16 08:55:35.712 CST: TCL script failure
Result:
bad index "next_tnt_digit_pos": must be integer or end?-integer?
Feb 16 08:55:35.712 CST: TCL script failure errorInfo:
bad index "next_tnt_digit_pos": must be integer or end?-integer?
while executing
"string index tnt_code next_tnt_digit_pos"
(procedure "act_Init_CallVar" line 28)
invoked from within
"act_Init_CallVar
(procedure "act_Setup" line 8)
invoked from within
"act_Setup"
Based on the output of the 'puts' command, the script failure should not be happening.
Anyone have any insight?
Thanks,
Jason
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Yaw-Ming Chen
Posts:
479
Join Date:
4/9/08
Recent Posts
RE: 'string list' not working right
Answer
2/16/11 4:51 PM as a reply to Jason Schwefel.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Please check syntax
string index $tnt_code $next_tnt_digit_pos
Thanks !
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Jason Schwefel
Posts:
5
Join Date:
8/1/09
Recent Posts
RE: 'string list' not working right
Answer
2/16/11 4:54 PM as a reply to Yaw-Ming Chen.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Please check syntax
string index $tnt_code $next_tnt_digit_pos
Thanks !
DUH!!!!
Thanks!
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top