cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
79
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

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
Please check syntax

string index $tnt_code $next_tnt_digit_pos

Thanks !


DUH!!!!
 
Thanks!
Getting Started

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:

Quick Links