<div dir="ltr"><div>Hi Paul,<br><br>Thank you for the reply and for the suggestion!<br><br></div>Regards,<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 20, 2014 at 8:23 AM, Paul Bignier <span dir="ltr"><<a href="mailto:paul.bignier@scilab-enterprises.com" target="_blank">paul.bignier@scilab-enterprises.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <br>
    Hello Eduardo,<br>
    <br>
    The call() primitive is not (yet?) suited for string matrices,
    because there is a confusion about the "size" of it: right now, the
    gateway detects the size of a scalar string, but when it is a
    matrix, each element can have a proper size (buffer) and there is
    also the matrix size itself.<br>
    To avoid this confusion, the gateway only allows scalar strings, so
    the "size" of the argument actually represents its length (for
    instance, ident="STR1" will be detected as having a 4x1 size).<br>
    <br>
    This is documented in the help <a href="http://help.scilab.org/docs/5.4.1/en_US/call.html" target="_blank">page</a>,
    the arguments can be "real matrices" or [scalar] "strings".<br>
    <br>
    So my only suggestion at the moment is to pass ident as the
    concatenation of its elements, and to split it (or iterate on its
    length) in the Fortran routine. ident = "STR1"+"STR2"+"STR3"+...<br>
    <br>
    Hope this helps, otherwise feel free to report a bug on
    
    <a href="http://bugzilla.scilab.org/" target="_blank">http://bugzilla.scilab.org/</a><br>
    Regards,<br>
    Paul<div><div class="h5"><br>
    <br>
    <br>
    <div>On 01/15/2014 09:01 PM, Eduardo
      Torrecillas wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>Hello all,<br>
                    <br>
                    I am very used to dynamic linking scilab and
                    Fortran, and call the external function by the
                    "call" function in SciLab.<br>
                    <br>
                  </div>
                  Although, this is the first time I try to send string
                  matrices as fortran arguments, and I can't get it
                  working. Maybe any of you can please help?<br>
                  <br>
                </div>
                <div>I want to pass a column-vector where each row
                  contains a 4-char string. Example:<br>
                  <br>
                </div>
                <div>ident=['STR1';'STR2';'STR3';...]<br>
                </div>
                <div><br>
                </div>
                Now the F90 code I'm trying:<br>
              </div>
              <br>
            </div>
            subroutine fhdg_dist(napt,ident,ret_val)<br>
            implicit none<br>
            INTEGER,INTENT(IN)::napt<br>
            character(len=4),intent(in),dimension(napt,1)::ident<br>
          </div>
          integer,intent(out)::ret_val<br>
          <br>
        </div>
        ret_val=0<br>
        <div>
          <div><br>
          </div>
          <div>end subroutine fhdg_dist<br clear="all">
          </div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div><br>
                      <br>
                    </div>
                    <div>the call statement:<br>
                      <br>
[ret_val]=call('fhdg_dist',napt,1,'i',ident,2,'c','out',[1,1],3,'i')<br>
                    </div>
                    <div><br>
                    </div>
                    <div>So, even if I'm not trying to use the matrix
                      data, when calling the external function with this
                      call, I get "incompatible dimensions" message.<br>
                      <br>
                      Any clues, please?<br>
                      <br>
                      Regards.<br>
                    </div>
                    <div><br>
                      <br>
                      -- <br>
                      Eduardo Torrecillas<br>
                      AER-09
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Paul BIGNIER
Scilab Engineer & Xcos Developer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: <a href="tel:%2B33.1.80.77.04.69" value="+33180770469" target="_blank">+33.1.80.77.04.69</a>
<a href="http://www.scilab-enterprises.com" target="_blank">http://www.scilab-enterprises.com</a> </pre>
  </font></span></div>

</blockquote></div><br><br clear="all"><br>-- <br>Eduardo Torrecillas<br>AER-09
</div>