summary refs log tree commit diff stats
path: root/nim/strutils.pas
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2009-06-24 17:13:22 +0200
committerAndreas Rumpf <rumpf_a@web.de>2009-06-24 17:13:22 +0200
commit300430fbba28b408f7ac86ca46b03d9d50839399 (patch)
treeb8a84f8efdccda7bfa909b3db911d9e2b9a4b39b /nim/strutils.pas
parent36818817bd61594ea6d106328bb8df0f5a25cfc4 (diff)
downloadNim-300430fbba28b408f7ac86ca46b03d9d50839399.tar.gz
overload resolution for proc vars
Diffstat (limited to 'nim/strutils.pas')
-rw-r--r--nim/strutils.pas11
1 files changed, 9 insertions, 2 deletions
diff --git a/nim/strutils.pas b/nim/strutils.pas
index 377d3abc6..f34379fcb 100644
--- a/nim/strutils.pas
+++ b/nim/strutils.pas
@@ -502,18 +502,25 @@ procedure addf(var result: string; const f: string; args: array of string);
 const
   PatternChars = ['a'..'z', 'A'..'Z', '0'..'9', '_', #128..#255];
 var
-  i, j, x: int;
+  i, j, x, num: int;
 begin
   i := 1;
+  num := 0;
   while i <= length(f) do
     if f[i] = '$' then begin
       case f[i+1] of
+        '#': begin
+          inc(i, 2);
+          add(result, args[num]);
+          inc(num);
+        end;
         '$': begin
           addChar(result, '$');
           inc(i, 2);
         end;
         '1'..'9': begin
-          add(result, args[ord(f[i+1]) - ord('0') - 1]);
+          num := ord(f[i+1]) - ord('0');
+          add(result, args[num - 1]);
           inc(i, 2);
         end;
         '{': begin