Category

Scripting

11 articles in this topic.

Practical Exposure to writing TCL with examples

Before explaining with the examples, let me clear few things. ⦁ Before going to write the script, first read all the blogs that I have mentioned in the TCL Scripting section. Once you have the problem statement, then understand what your requirement is here and then think how you can get the solution. Now try […]
Admin · December 10, 2020

Regular Expressions in TCL

Regular expressions in TCL are a way to search text. These help us to find a particular character and then we can use our ways to deal with it. “regexp” represents the regular expression. This helps to match a character in TCL. Below are the few matching expressions. #1. X -> Exact match. #2. [a-z] […]
Admin · December 9, 2020

File IO in TCL

There are basically three modes of handling files. Read, Write and Append. Below are the ways: #1. r -> Read a file, file must exist. #2. w -> Write a file, If file exists, then file will get truncated. #3. a -> Append the file, file must exist. #4. r+ -> Open a file for […]
Admin · December 8, 2020

Procedure in TCL

There are number of scripts which can be executed more than once, to utilize the reusability we use procedure in TCL. Syntax: Proc proc_name {argument} { Body } Eg. #1. proc add {a b} { return [expr $a + $b] } Now we can use this proc number of times whenever we need to add […]
Admin · December 7, 2020

List in TCL

There are following ways to set a list of variables in a variable. ##Normally we define a list of variables in this format. set variable {value1 value2 ….. valuen} set variable “value1 value2 ….. valuen” ##If you have variables in list. set variable [list value1 value2 …… valuen] ##When you deal with a file where […]
Admin · December 6, 2020

String in TCL

We know that variable value can be in the form of a number or string. Working with string in tcl, we can have many ways to take care of things. set a 10; set a apple; With the above example we can see that ‘a’ can have the value 10 or apple. There are two […]
Admin · December 5, 2020