cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1596
Views
0
Helpful
1
Replies

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 1

Joe Clarke
Cisco Employee
Cisco Employee

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"] {

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: