Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Tcl Format Question

Hello Community,

Can someone please tell me if the following format would work:

foreach tag [list "SLA1_Towerbridge_10.1.1.4"_

"SLA2_LondonBridge_180.80.8.4"_

"SLA3_Paddington_170.70.7.4"_

"SLA4_150.50.5.2"_

"SLA5_160.60.6.1"] {

    if { [info exists mar_einfo($tag)] } {

        break

    }

}

I'm trying to shorten the length of line of code by adding a carriage return, instead of having to do the following:

foreach tag [list "SLA1_Towerbridge_10.1.1.4" "SLA2_LondonBridge_180.80.8.4" "SLA3_Paddington_170.70.7.4" "SLA4_150.50.5.2" SLA5_160.60.6.1"] {

    if { [info exists mar_einfo($tag)] } {

        break

    }

}

Cheers

Carlton

1 REPLY
Cisco Employee

Tcl Format Question

You need to use a '\' character to break up lines:

foreach tag [list "SLA1_Towerbridge_10.1.1.4" \

"SLA2_LondonBridge_180.80.8.4" "SLA3_Paddington_170.70.7.4""SLA4_150.50.5.2" SLA5_160.60.6.1"] {

307
Views
0
Helpful
1
Replies
CreatePlease login to create content