puts "Hello, World!" set feature "auc {imsi 502120121870490 encKey AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDD algoId 3 kdbId 1 acsub 2} hlr {ntype multi sr 1 rr RR01 ucsiserv UC_ENT odboc 4 odbr 0 odbic 3 obGprs 2 osb1 false osb2 true supportNewRadioSecondaryRAT true ts21 {msisdn 60121837476} ts11 {msisdn 60121837476 bcieID TS11} gprs {} bs30genr {msisdn 60121837476 bcieID BS30GENR} ts22 {} roamSubscription {roamSubscriptionInfo Post01} baic {basicServiceGroup TS10-telephony status 5} baoc {basicServiceGroup TS10-telephony status 5} baic {basicServiceGroup BS30-dataSync status 5} baoc {basicServiceGroup BS30-dataSync status 5} baoc {basicServiceGroup TS20-shortMessage status 5} umtsSubscriber {accTypeGSM true accTypeGERAN true accTypeUTRAN true} tcsi {operatorServiceName TC_ENT} ocsi {operatorServiceName OC_ENT} pdpContext {id 2 type 2 qosProfile QOS04 apn {Legacy Gloria IOT (Static)} apnArea HPLMN extType 5} eps {defaultPdnContextId 1 maxBandwidthUp 150000000 maxBandwidthDown 1000000000 extMaxBandwidthUp 4294967 extMaxBandwidthDown 10000000} epsPdnContext {contextId 1 type both pdnGwDynamicAllocation true vplmnAddressAllowed false maxBandwidthUp 150000000 maxBandwidthDown 300000000 qos LTE1 apn {Legacy Gloria IOT (Static)} extMaxBandwidthUp 4294967 extMaxBandwidthDown 10000000} } maxisVAS {vasAccSysAddressInfo 94 vasAccountStatus a vasLanguageId 1 vasServiceClass 00 vasSubClass GPSHX vasSimType 13 msisdn 60121837476}" set pdp_context "id type address qosProfile apn apnArea extType chargingCharacteristicsProfile" for {set i 0} {$i < [llength $feature]} {incr i 2} { set fn [lindex $feature $i] set fv [lindex $feature [expr $i+1]] puts $fv }
Write, Run & Share TCL code online using OneCompiler's TCL online compiler for free. It's one of the robust, feature-rich online compilers for TCL language, running the latest TCL version 8.6. Getting started with the OneCompiler's TCL editor is easy and fast. The editor shows sample boilerplate code when you choose language as TCL and start coding.
OneCompiler's TCL online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample TCL program which takes name as input and prints hello message with your name.
set name [gets stdin]
puts "Hello $name"
Tool Command Language(TCL) is a general purpose scripting language which is commonly used for GUIs and for testing. Everything is by default string in TCL. It was created by John Osterhout in 1989.
Variable is a identifier which is used to hold the value. set
is used to create variables.
set name onecompiler
When ever you want to perform a set of operations based on a condition IF-ELSE is used.
if(conditional-expression) {
#code
} else {
#code
}
You can also use if-else for nested Ifs and If-Else-If ladder when multiple conditions are to be performed on a single variable.
Switch is an alternative to If-Else-If ladder.
switch(conditional-expression) {
value1 {
# code
}
value1 {
# code
}
...
default {
# code
}
For loop is used to iterate a set of statements based on a condition.
for{start}{test}{next}{
# code
}
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while(condition) {
# code
}
Array is a collection of similar data which is stored in continuous memory addresses. Array values can be fetched using index. Index starts from 0 to size-1.
set ArrayName(Index) value
Procedure is a sub-routine which contains set of statements. Uusually procedures are required when multiple calls are made to same set of statements. Procedures increases re-usuability and modularity.
proc procedureName {arguments} {
# code
}