' author: Uwe Keim, keim@zeta-software.de zeta software GbR, Germany. ' modified by: Nic ' version: 2000-01-02 ' description: works like the printf-function in C. ' Takes a string with format characters and an array to expand. Function fmt(str, args) res = "" : pos = 0 For i = 1 to Len(str) If Mid(str, i, 1) = "%" Then If i < Len(str) Then If Mid(str, i + 1, 1) = "%" Then res = res & "%" i = i + 1 ElseIf Mid(str, i + 1, 1) = "x" Then res = res & CStr(args(pos)) If Ubound(args) > pos Then pos = pos + 1 i = i + 1 End If End If Else res = res & Mid(str, i, 1) End If Next fmt = res End Function