From 300430fbba28b408f7ac86ca46b03d9d50839399 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 24 Jun 2009 17:13:22 +0200 Subject: overload resolution for proc vars --- nim/strutils.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'nim/strutils.pas') 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 -- cgit 1.4.1-2-gfad0