Hello Jens,

Le 06/12/2021 à 10:40, Jens Simon Strom a écrit :
Hi Samuel,
Your solution is quite sophisticated.


On the opposite, it aims to be simpler.


To me it was confusing to call a function without the input being bracketed. And on top of this, that a variable of type /constant/ is accepted as a /string/ within the function.

As a cherry on the cake, the syntax will work as well for literal values:

function  printc(name)
    execstr("c = "+name)
    //Drucken einer komplexen Zahl mit Betrag und Winkel/°
  Format  =  strsubst(name,"%","%%")+': %f /_%7.2f°\n'
    mprintf(Format,  abs(c),  180/%pi*atan(imag(c),  real(c)))
endfunction

--> printc 3-4*%i
3-4*%i: 5.000000    /_ -53.13°


Scilab seems to be more flexible than I would dare to imagine before now.


Handiness is one of the signatures of high level languages.

Samuel
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to