tcl Expressions Multiplying a variable by 17

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

set myVariable [expr { $myVariable * 17 }]

This shows how you can use a simple expression to update a variable. The expr command does not update the variable for you; you need to take its result and write it to the variable with set.

Note that newlines are not important in the little language understood by expr, and adding them can make longer expressions much easier to read.

set myVariable [expr {
    $myVariable * 17
}]

This does exactly the same thing though.



Got any tcl Question?