summary refs log tree commit diff stats
path: root/doc/tut2.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/tut2.txt')
-rwxr-xr-xdoc/tut2.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/tut2.txt b/doc/tut2.txt
index 9017bd7e0..7276a8f12 100755
--- a/doc/tut2.txt
+++ b/doc/tut2.txt
@@ -387,17 +387,17 @@ The `try`:idx: statement handles exceptions:
     f: TFile
   if open(f, "numbers.txt"):
     try:
-      var a = readLine(f)
-      var b = readLine(f)
-      echo("sum: " & $(parseInt(a) + parseInt(b)))
+      let a = readLine(f)
+      let b = readLine(f)
+      echo "sum: ", parseInt(a) + parseInt(b)
     except EOverflow:
-      echo("overflow!")
+      echo "overflow!"
     except EInvalidValue:
-      echo("could not convert string to integer")
+      echo "could not convert string to integer"
     except EIO:
-      echo("IO error!")
+      echo "IO error!"
     except:
-      echo("Unknown exception!")
+      echo "Unknown exception!"
       # reraise the unknown exception:
       raise
     finally: