Advertisement
Guest User

Untitled

a guest
Aug 15th, 2014
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
REBOL 0.49 KB | None | 0 0
  1. MsgBox FormatKeyWordArgs("$doto, $pudge", "doto:1", "pudge:3")
  2.  
  3. Public Function FormatKeyWordArgs(line As String, ParamArray kwargs()) As String
  4.   If UBound(kwargs) <> 0 Then
  5.     For Each key In kwargs
  6.       words = Split(key, ":")
  7.       line = Replace(line, "$" & words(0), words(1))
  8.     Next
  9.   Else
  10.     On Error Resume Next
  11.       words = Split(kwargs(0), ":")
  12.     If Err.Number = 0 Then
  13.       line = Replace(line, "$" & words(0), words(1))
  14.     End If
  15.   End If
  16.   FormatKeyWordArgs = line
  17. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement