> > First params typically assembles to this:
> > x1.to_s + ', ' + x2.to_s + ', ' + x3.to_s + ', ' + x4.to_s
>
> That does not look good. =A0If you have to encode numbers in variable
> names, you probably rather want to use an Array for that or even
> generate that directly:
>
> params =3D no_of_params.times.map {|i| "x#{i}"}.join(', ')

your example generates code looks like this:
params =3D x1, x2, x3, x4
But with that I get an error (eval):3:in `+': can't convert Fixnum
into String (TypeError)

If it should work, I recon that it has to look like this:
params =3D "\"\#{" + no_of_params.times.map {|i| "x#{i}"}.join("}, \#{")
+ "}\""

becaus I need the generated code to look like this:
params =3D "#{x1}, #{x2}, #{x3}, #{x4}"


> handle.call(['MethodNameIn','Params'],[#{method},params]);
Yes, this was a bug...


> params_2 =3D "#{x1}, #{x2}, #{x3}, #{x4}"
Yes, I could use this, but still I need to assembly this line since I
dont know the number of input parameters at coding time. And I know
that no input parameters contain any expressions that needs to be
evaluated since it is an input from my generated function.



Join and times.map was kind of cool, my prototype has now replaced the
first loops with this:
arg_list =3D no_of_params.times.map {|i| "x#{i}"}.join(", ")
args =3D no_of_params.times.map {|i| "x#{i}.to_s"}.join("+','+")

(Using #{} instead of .to_s is basically the same:
args =3D "\"\#{" + no_of_params.times.map {|i| "x#{i}"}.join("}, \#{") +
"}\""

BR,
Andreas