Le 22/02/2016 12:12, Antoine Monmayrant a écrit : Le Lundi 22 Février 2016 12:04 CET, "Antoine Monmayrant" <amonm...@laas.fr> a écrit:
  Le Lundi 22 Février 2016 11:51 CET, Serge Steer <serge.st...@inria.fr> a 
écrit:
The following function does the job:

function myload()
    txt=["a=1";"b=2"];
    ncur= size(who("local"),"*")
    execstr(txt);
    vars=who("local");
    vars=vars(1:size(vars,'*')-ncur-1)
    args=strcat(vars,",")
    execstr("["+args+"]=resume("+args+")")
endfunction
Thank you Serge!
It does work on 5.5.0, but it does not work on 6.6.0-beta1.
It might be due to the way variables are ordered when calling "who".
OK, it seems that "who" no longer list variables with the most recent at the 
top, but in alphabetical order.
.
You can use setdiff() to get the names of the new variables, knowing the former set, whatever is their order. Then, you will need to the same before and after calling the function, to get the unknown names of returned variables.

Samuel

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to