Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
Created by: Jason Schwefel on 16-02-2011 09:58:50 AM 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 😎 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
Subject: RE: 'string list' not working right Replied by: Yaw-Ming Chen on 16-02-2011 10:51:27 AM Please check syntax
string index $tnt_code $next_tnt_digit_pos
Thanks !
Subject: RE: 'string list' not working right Replied by: Jason Schwefel on 16-02-2011 10:54:08 AM
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: