<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 04/03/2016 23:33, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote cite="mid:56DA0D4A.8090703@free.fr" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Le 02/03/2016 12:24, David Chèze a
        écrit :<br>
      </div>
      <blockquote cite="mid:1456917849551-4033598.post@n3.nabble.com"
        type="cite">
        <pre wrap="">Hi all,

I would like to define a variable in a user module in such a way that this
constant would be available for all functions (also out of the module) as a
"hidden(you don't need to see it inbrowsvar), protected (should not be
possible to clear it, even with clearglobal )" global variable as soon the
module is loaded: do you have suggestions how to do it within scilab?</pre>
      </blockquote>
      <br>
      There is still no actual solution to protect variables against
      clear.<br>
    </blockquote>
    .<br>
    Actually, there are one or two solutions :<br>
    <ol>
      <li> Set and store your constants in a TCL session (the main one
        or a slave), and recall them from it. Data in TCL sessions are
        not cleared by clear() nor by clearglobal(). This is what i use
        in drivers published on the fileexchange to set/get "persistent"
        communication parameters with devices.<br>
      </li>
      <li>May be the same could be possible with java objects? I have
        never tried.</li>
      <li>Another solution is to use the userdata field of the default
        figure. The default figure (gdf()) is not clearable. But then
        all your graphic windows will embed your constants in their
        .userdata. So it is preferable not to have MBytes of constantes
        ;) And to set a struct() in userdata. This is a rather bad
        hacking.<br>
      </li>
    </ol>
    May be there are other solutions. Let's free your imagination :)<br>
    <br>
    Samuel<br>
    <br>
  </body>
</html>