[Scilab-users] Calling a java method in a Scilab function

n.gulunay n.gulunay at gmail.com
Sat Dec 10 16:03:51 CET 2016


    
Hi,
I thought I unsubscribed from this mailing list but I am still getting them. 
I even deleted my user name at one point but still kept getting them. 
Currently I appear to be unsubscribed as the system suggests I subscribe yet I am still getting many emails. I would rather sign on and look up what I need.
 Is there more than once place to unsubscribe or is the unsubscribe function not working? Could someone please let me know how to proceed.Nec


Sent via the Samsung GALAXY S® 5, an AT&T 4G LTE smartphone

-------- Original message --------
From: Samuel Gougeon <sgougeon at free.fr> 
Date: 12/10/16  8:09 AM  (GMT-06:00) 
To: Users mailing list for Scilab <users at lists.scilab.org> 
Subject: Re: [Scilab-users] Calling a java method in a Scilab function 


    Hello Pierre,

      

      Le 07/12/2016 10:04, Pierre Vuillemin a écrit :

    
    Hi all,
      

      

      I have to create unique IDs for some object in Scilab. For that
      purpose, someone kindly guided me towards the UUID class of java,
      which lead me to create this function in Scilab,
      

      

      function id = make_id()
      

         UUID     = jimport("java.util.UUID", %f)
      

         tmp      = jinvoke(UUID,"randomUUID")
      

         id       = jinvoke(tmp,"toString")
      

      endfunction
      

      

      It works fine.
      

      

      An a priori similar function is
      

      

      function id = make_id_err()
      

         UUID     = jimport("java.util.UUID", %f)
      

         tmp      = UUID.randomUUID()
      

         id       = tmp.toString()
      

      endfunction
      

      

      where the methods are called without jinvoke. While the
      instructions of the latter function work well in the terminal,
      they lead to an error when trying to exec the function
      'make_id_err'.
      

      

      I was wondering if it is a normal behaviour?
      

    
    No, but the bug is fixed in Scilab 6.0:

        

        In Scilab 5.5.2:

        -->endfunction

         UUID     = jimport("java.util.UUID", %f)

                      !--error 26 

      Récursivité trop complexe ! (Les tables de récurrence
        sont pleines)

      at line       2 of function make_id_err called by :  

         tmp      = UUID.randomUUID()

      at line       3 of function make_id_err called by :  

         tmp      = UUID.randomUUID()

      at line       3 of function make_id_err called by :  

      ... etc

    

    In Scilab 6.0:

    --> getversion("scilab")

    
       ans  =

    
         6.   0.   0.   1.477D+09

    
      

      --> function id = make_id_err()

      >    UUID     = jimport("java.util.UUID", %f)

      >    tmp      = UUID.randomUUID()

      >    id       = tmp.toString()

      > endfunction

    

    --> make_id_err()

     ans  =

     49e4f3f1-736a-435f-bc26-f7061f10de27

    

    BR

    Samuel 

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161210/c73e756a/attachment.htm>


More information about the users mailing list