<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body 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">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
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a href="http://bugzilla.scilab.org/">http://bugzilla.scilab.org/</a><br>
Regards,<br>
Paul<br>
<br>
<br>
<div class="moz-cite-prefix">On 01/15/2014 09:01 PM, Eduardo
Torrecillas wrote:<br>
</div>
<blockquote
cite="mid:CADqPe=sAMCok7uLD=LctbE0JKOpENwEsNHe1N_+jdV==0PCfzA@mail.gmail.com"
type="cite">
<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 class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Paul BIGNIER
Scilab Engineer & Xcos Developer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
<a class="moz-txt-link-freetext" href="http://www.scilab-enterprises.com">http://www.scilab-enterprises.com</a> </pre>
</body>
</html>