Save and restore namespace

Hi
I am trying to generate a form using gtk in module; the problem arise when I (de)generate two form because the data of the second form obfuscates that of the first.
I only have two alternatives in mind:

  • save the namespace
  • passing a namespace to the modue function
    Are these solutions possible?
    Thanks

Hi,
Having some (minimal, runnable) code would help a lot in understanding the issue clearly.

Thanks
How attach the code (two scripts of over 500 lines)?
I know why the program faults, is because I can’t instantiate two copy of the module.
regards

Make a copy of the scripts, then try and remove all the parts of it that are not essential to this issue. Keep just the minimal parts that produce the same error when you run it, and post that code.

There’s more tips about providing useful info while asking questions, in this thread: “make it easier to help you”.

I’m slightly confused what you mean. You have teo forms you built with Gtk, but there are name collisons? Maybe just use each form within a module to have separate namepsaces for each.

Thanks
I know where is the “error” at bottom a very essential of I am doing.
The second call of the form obviously replaces the data, for this I am asking if I can force a new namespace at every call.

function answer(data)
println(data["Condor"])
end
module formgen
export formGen
function formGen(frm,answer)
    println("*** $frm ***")
    global callBack = answer
    wdgx = split(frm," ";keepempty=false)
    data = Dict()
    for i = 1:length(wdgx)
        println("$i: ",wdgx[i])
        data[wdgx[i]] = i
    end
        callBack(data)
end
end
println("First call")
formgen.formGen("El Condor",answer)
println("Second call")
formgen.formGen("Star FormGen",answer)

Thanks Mkitti
your answer confirms to me that it is possible to have the same module acting on different namespaces, however i have no idea how to do this.

Thanks Mkitti
your answer confirms to me that it is possible to have the same module acting on different namespaces, however i have no idea how to do this.

condor.gif