* 'oemtochar' and 'chartooem' functions (windows_tools) are obsolete and will be
removed in Scilab 5.4.1.
+* 'code2str' and 'str2code' are obsolete and will be removed on 5.4.1, please use
+ 'ascii' instead.
+
Removed Functions (previously declared as obsolete)
====================================================
* Bug #9963 fixed - The assert_computedigits function was not vectorized.
* Bug #9966 fixed - The default value of comptype in assert_checkalmostequal
- was wrongly chosen.
* Bug #9971 fixed - GLoad macro not used and not documented has been removed.
// Windows Case
- if (abs(str2code(part(pathname,1))) >= 10) ..
- & (abs(str2code(part(pathname,1))) <= 35) ..
- & (part(pathname,2) == ":") then
+ if isletter(part(pathname,1)) & (part(pathname,2) == ":") then
status = %T;
end
ch=idl-256*k
if ch==40 then
n=i-1
- v=code2str(str)
+ v=_code2str(str)
return
end
idl=k
str(i)=ch
end
i1=i1+4
- v=code2str(str)
+ v=_code2str(str)
end
endfunction
if ip==99|ip==2 then
ip=''
else
- ip=code2str(ip)
+ ip=_code2str(ip)
end
op=matrix(op(3:$),2,-1)
lhs=size(op,2)
end
elseif sym==quote then
// Check if transpose or beginning of a string
- if abs(str2code(psym))>=36&psym<>')'&psym<>']'&psym<>'.'&psym<>quote then // Not a transpose
+ if abs(_str2code(psym))>=36&psym<>')'&psym<>']'&psym<>'.'&psym<>quote then // Not a transpose
strcnt=1
elseif bcount<>0 then // Inside a matrix definition
if part(str,ksym-1)==' ' then strcnt=1,end
txt=mgetl(pathconvert(TMPDIR)+fnam+".m")
end
-txt=strsubst(txt,code2str(-40),"")
+txt = strsubst(txt, ascii(9), "")
[helppart,txt,batch]=m2sci_syntax(txt)
// save txt vector, helpart and batch after the syntax modification
if strindex(fil,TMPDIR)==[] then
// Because if it is associated to digit, dot is suppressed by comp()
kdot=strindex(tk,[".*","./",".\",".^",".''"])
if kdot<>[] then
- kdgt=kdot(find(abs(str2code(part(tk,kdot-1)))<9))
+ kdgt=kdot(find(abs(_str2code(part(tk,kdot-1)))<9))
for kk=size(kdgt,"*"):-1:1
tk=part(tk,1:kdgt(kk)-1)+" "+part(tk,kdgt(kk):length(tk));
end
m2sci_info(gettext("M-file reading: Done"),-1);
//Replace TAB by SPACE
-txt=strsubst(txt,code2str(-40),"")
+txt=strsubst(txt, ascii(9), "");
if txt==[] then
m2sci_infos(msprintf(gettext("File %s is an empty file.\n"),fil),-1);
end
end
if ( (mtlb_opts <> []) & (strindex("-tabs",mtlb_opts)<>[]) ) then
- sep=code2str(-40)
+ sep = ascii(9);
else
sep=" "
end
outmask=ipar(imask+ievt:imask+nout+ievt-1)
lfil=ipar(1)
lfmt=ipar(2)
- if lfil>0 then fname=code2str(ipar(5:4+lfil)),else fname=' ',end
- if lfmt>0 then Fmt=code2str(ipar(5+lfil:4+lfil+lfmt)),else Fmt=' ',end
+ if lfil>0 then fname=_code2str(ipar(5:4+lfil)),else fname=' ',end
+ if lfmt>0 then Fmt=_code2str(ipar(5+lfil:4+lfil+lfmt)),else Fmt=' ',end
label=[ sci2exp(tmask);
sci2exp(outmask);
fname;
N=ipar(4)
lfil=ipar(1)
lfmt=ipar(2)
- if lfil>0 then fname=code2str(ipar(5:4+lfil)),else fname=' ',end
- if lfmt>0 then Fmt=code2str(ipar(5+lfil:4+lfil+lfmt)),else Fmt=' ',end
+ if lfil>0 then fname=_code2str(ipar(5:4+lfil)),else fname=' ',end
+ if lfmt>0 then Fmt=_code2str(ipar(5+lfil:4+lfil+lfmt)),else Fmt=' ',end
label=[sci2exp(in);
fname;
Fmt;
else
model.blocktype = 'd';
end
- model.ipar=[nz;length(varnam);str2code(varnam)]
+ model.ipar=[nz;length(varnam);_str2code(varnam)]
graphics.exprs=exprs
x.graphics=graphics;
x.model=model;
model.evtin = [1];
model.evtout = [];
model.rpar = [];
- model.ipar = [nz;length(varnam);str2code(varnam)];
+ model.ipar = [nz;length(varnam);_str2code(varnam)];
model.blocktype = 'd';
model.firing = [];
model.dep_ut = [%f %f];
end
if ok then
- ipar=[length(fname1);length(frmt1);0;N;str2code(fname1);str2code(frmt1)]
+ ipar=[length(fname1);length(frmt1);0;N;_str2code(fname1);_str2code(frmt1)]
if prod(size(dstate))<>(nin+1)*N+2 then
dstate=[-1;lunit;zeros((nin+1)*N,1)]
end
model.in=in
model.evtin=1
model.dstate=[-1;lunit;zeros((nin+1)*N,1)]
- model.ipar=[length(fname);length(frmt);0;N;str2code(fname);str2code(frmt)]
+ model.ipar=[length(fname);length(frmt);0;N;_str2code(fname);_str2code(frmt)]
model.blocktype='d'
model.dep_ut=[%t %f]
end
if ok then
- ipar=[length(fname1);str2code(frmt1);N;swap;str2code(fname1)]
+ ipar=[length(fname1);_str2code(frmt1);N;swap;_str2code(fname1)]
if prod(size(dstate))<>(nin+1)*N+2 then
dstate=[-1;lunit;zeros((nin+1)*N,1)]
end
model.in=in
model.evtin=1
model.dstate=[-1;lunit;zeros((nin+1)*N,1)]
- model.ipar=[length(fname);str2code(frmt);N;swap;str2code(fname)]
+ model.ipar=[length(fname);_str2code(frmt);N;swap;_str2code(fname)]
model.blocktype='d'
model.dep_ut=[%t %f]
frmt1=part(frmt1,1:3)
if ok then
- ipar=[length(fname1);str2code(frmt1);N;swap;str2code(fname1)]
+ ipar=[length(fname1);_str2code(frmt1);N;swap;_str2code(fname1)]
if prod(size(dstate))<>(nin+1)*N+2 then
dstate=[-1;lunit;zeros((nin+1)*N,1)]
end
model.in=in
model.evtin=1
model.dstate=[-1;lunit;zeros((nin+1)*N,1)]
- model.ipar=[length(fname);str2code(frmt);N;swap;str2code(fname)]
+ model.ipar=[length(fname);_str2code(frmt);N;swap;_str2code(fname)]
model.blocktype='d'
model.dep_ut=[%t %f]
end
if ok then
- model.ipar=[length(varnam);str2code(varnam);Method;ZC;OutEnd;];
+ model.ipar=[length(varnam);_str2code(varnam);Method;ZC;OutEnd;];
[model,graphics,ok]=set_io(model,graphics,list(),list([-1,-2],-1),1,1);
if ok then
graphics.exprs=exprs;
model.out=-1
model.out2=-2
model.outtyp=-1
- model.ipar=[length(varnam);str2code(varnam);Method;ZC;OutEnd;];
+ model.ipar=[length(varnam);_str2code(varnam);Method;ZC;OutEnd;];
model.evtin=[1];
model.evtout=[1];
model.firing=[0];
frmt1=part(frmt1,1:3);
if ok then
ipar=[length(fname1);
- str2code(frmt1);
+ _str2code(frmt1);
0;
N;
M;
swap;
offset
- str2code(fname1);
+ _str2code(fname1);
tmask1
outmask(:)]
if prod(size(dstate))<>(N*M)+3 then
model.out=nout
model.evtin=1
model.dstate=[1;1;lunit;zeros(N*M,1)]
- model.ipar=[length(fname);str2code(frmt);ievt;N;M;swap;offset;str2code(fname);
+ model.ipar=[length(fname);_str2code(frmt);ievt;N;M;swap;offset;_str2code(fname);
tmask;outmask]
model.blocktype='d'
model.dep_ut=[%f %f]
ipar = [ ...
length(fname1); ...
- str2code(frmt1); ...
+ _str2code(frmt1); ...
ievt; ...
N; ...
M; ...
swap; ...
offset; ...
- str2code(fname1); ...
+ _str2code(fname1); ...
tmask1; ...
outmask(:) ...
];
nout = size(outmask,"*")
ipar = [ ...
- length(fname); str2code(frmt); ievt; N; M; ...
- swap;offset; str2code(fname); tmask; outmask ...
+ length(fname); _str2code(frmt); ievt; N; M; ...
+ swap;offset; _str2code(fname); tmask; outmask ...
];
model = scicos_model()
model.evtout = []
model.dstate = [1; 1; lunit; zeros(N*M,1)]
model.ipar = [ ...
- length(fname); str2code(frmt); ievt; N; M; ...
- swap; offset;str2code(fname); ...
+ length(fname); _str2code(frmt); ievt; N; M; ...
+ swap; offset;_str2code(fname); ...
tmask; outmask ...
];
length(frmt1); ...
ievt; ...
N; ...
- str2code(fname1); ...
- str2code(frmt1); ...
+ _str2code(fname1); ...
+ _str2code(frmt1); ...
tmask1; ...
outmask(:) ...
];
outmask = 1
ipar = [ ...
length(fname);length(frmt);0;N; ...
- str2code(fname);str2code(frmt); ...
+ _str2code(fname);_str2code(frmt); ...
tmask;outmask ...
];
model.dstate = dstate
model.ipar = [ ...
length(fname);length(frmt);0;N; ...
- str2code(fname);str2code(frmt); ...
+ _str2code(fname);_str2code(frmt); ...
tmask;outmask ...
];
xmlns:db="http://docbook.org/ns/docbook">
<info>
<pubdate>$LastChangedDate: 2006-08-08 16:57:13 +0200 (Tue, 08 Aug 2006)
- $</pubdate>
+ $
+ </pubdate>
</info>
-
+
<refnamediv>
<refname>code2str</refname>
-
+
<refpurpose>returns character string associated with Scilab integer
- codes.</refpurpose>
+ codes. <emphasis role="bold">This function is obsolete.</emphasis>
+ </refpurpose>
</refnamediv>
-
+
<refsynopsisdiv>
<title>Calling Sequence</title>
-
+
<synopsis>str=code2str(c)</synopsis>
</refsynopsisdiv>
-
+
<refsection>
<title>Arguments</title>
-
+
<variablelist>
<varlistentry>
<term>str</term>
-
+
<listitem>
<para>A character string</para>
</listitem>
</varlistentry>
-
+
<varlistentry>
<term>c</term>
-
+
<listitem>
<para>vector of character integer codes</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
-
+
<refsection>
<title>Description</title>
-
+
<para>Returns character string associated with Scilab integer codes.str is
- such that c(i) is the Scilab integer code of part(str,i))</para>
+ such that c(i) is the Scilab integer code of part(str,i))
+ </para>
</refsection>
-
+
<refsection>
<title>Examples</title>
-
+
<programlisting role="example"><![CDATA[
code2str([-28 12 18 21 10 11])
str2code('Scilab')'
]]></programlisting>
</refsection>
-
+
<refsection role="see also">
-<title>See Also</title>
-
+ <title>See Also</title>
+
<simplelist type="inline">
- <member><link linkend="str2code">str2code</link></member>
-
- <member><link linkend="ascii">ascii</link></member>
+ <member>
+ <link linkend="str2code">str2code</link>
+ </member>
+
+ <member>
+ <link linkend="ascii">ascii</link>
+ </member>
</simplelist>
</refsection>
+
+ <refsection>
+ <title>History</title>
+ <revhistory>
+ <revision>
+ <revnumber>5.4.0</revnumber>
+ <revremark>This function will be removed in Scilab 5.4.1</revremark>
+ </revision>
+ </revhistory>
+ </refsection>
+
</refentry>
<refsection>
<title>Examples</title>
<programlisting role="example"><![CDATA[
-isascii(code2str(300))
-isascii(code2str(-11))
letters = [115. 99. 105. 108. 97. 98.]
isascii(letters)
ascii(letters)
xmlns:db="http://docbook.org/ns/docbook">
<info>
<pubdate>$LastChangedDate: 2006-08-08 16:57:13 +0200 (Tue, 08 Aug 2006)
- $</pubdate>
+ $
+ </pubdate>
</info>
-
+
<refnamediv>
<refname>str2code</refname>
-
+
<refpurpose>return scilab integer codes associated with a character
- string</refpurpose>
+ string. <emphasis role="bold">This function is obsolete.</emphasis>
+ </refpurpose>
</refnamediv>
-
+
<refsynopsisdiv>
<title>Calling Sequence</title>
-
+
<synopsis>c=str2code(str)</synopsis>
</refsynopsisdiv>
-
+
<refsection>
<title>Arguments</title>
-
+
<variablelist>
<varlistentry>
<term>str</term>
-
+
<listitem>
<para>A character string.</para>
</listitem>
</varlistentry>
-
+
<varlistentry>
<term>c</term>
-
+
<listitem>
<para>A vector of character integer codes</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
-
+
<refsection>
<title>Description</title>
-
+
<para>Return c such that c(i) is the scilab integer code of
- part(str,i))</para>
+ part(str,i))
+ </para>
</refsection>
-
+
<refsection>
<title>Examples</title>
-
+
<programlisting role="example"><![CDATA[
str2code('Scilab')'
code2str([-28 12 18 21 10 11])
]]></programlisting>
</refsection>
-
+
<refsection role="see also">
-<title>See Also</title>
-
+ <title>See Also</title>
+
<simplelist type="inline">
- <member><link linkend="code2str">code2str</link></member>
-
- <member><link linkend="ascii">ascii</link></member>
+ <member>
+ <link linkend="code2str">code2str</link>
+ </member>
+
+ <member>
+ <link linkend="ascii">ascii</link>
+ </member>
</simplelist>
</refsection>
+
+ <refsection>
+ <title>History</title>
+ <revhistory>
+ <revision>
+ <revnumber>5.4.0</revnumber>
+ <revremark>This function will be removed in Scilab 5.4.1</revremark>
+ </revision>
+ </revhistory>
+ </refsection>
+
</refentry>
]]></programlisting>
</refsection>
- <refsection role="see also">
- <title>参照</title>
-
- <simplelist type="inline">
- <member><link linkend="code2str">code2str</link></member>
-
- <member><link linkend="str2code">str2code</link></member>
- </simplelist>
- </refsection>
</refentry>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- -->
-<refentry version="5.0-subset Scilab" xml:id="code2str" xml:lang="ja"
- xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:ns3="http://www.w3.org/1999/xhtml"
- xmlns:mml="http://www.w3.org/1998/Math/MathML"
- xmlns:db="http://docbook.org/ns/docbook">
- <info>
- <pubdate>$LastChangedDate: 2006-08-08 16:57:13 +0200 (Tue, 08 Aug 2006)
- $</pubdate>
- </info>
-
- <refnamediv>
- <refname>code2str</refname>
-
- <refpurpose>
- Scilab整数コードが示す文字列を返す.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <title>呼び出し手順</title>
-
- <synopsis>str=code2str(c)</synopsis>
- </refsynopsisdiv>
-
- <refsection>
- <title>パラメータ</title>
-
- <variablelist>
- <varlistentry>
- <term>str</term>
-
- <listitem>
- <para>文字列</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>c</term>
-
- <listitem>
- <para>整数コードを表す文字のベクトル</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
-
- <refsection>
- <title>説明</title>
-
- <para>
- Scilab整数コードが示す文字列を返します.
- str は c(i) が part(str,i) のScilab整数コードであるような
- 文字列です.</para>
- </refsection>
-
- <refsection>
- <title>例</title>
-
- <programlisting role="example"><![CDATA[
-code2str([-28 12 18 21 10 11])
-str2code('Scilab')'
- ]]></programlisting>
- </refsection>
-
- <refsection role="see also">
- <title>参照</title>
-
- <simplelist type="inline">
- <member><link linkend="str2code">str2code</link></member>
-
- <member><link linkend="ascii">ascii</link></member>
- </simplelist>
- </refsection>
-</refentry>
<refsection>
<title>例</title>
<programlisting role="example"><![CDATA[
-isascii(code2str(300))
-isascii(code2str(-11))
letters = [115. 99. 105. 108. 97. 98.]
isascii(letters)
ascii(letters)
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- -->
-<refentry version="5.0-subset Scilab" xml:id="str2code" xml:lang="ja"
- xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:ns3="http://www.w3.org/1999/xhtml"
- xmlns:mml="http://www.w3.org/1998/Math/MathML"
- xmlns:db="http://docbook.org/ns/docbook">
- <info>
- <pubdate>$LastChangedDate: 2006-08-08 16:57:13 +0200 (Tue, 08 Aug 2006)
- $</pubdate>
- </info>
-
- <refnamediv>
- <refname>str2code</refname>
-
- <refpurpose>
- 文字列が示すScilab整数コードを返す</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <title>呼び出し手順</title>
-
- <synopsis>c=str2code(str)</synopsis>
- </refsynopsisdiv>
-
- <refsection>
- <title>パラメータ</title>
-
- <variablelist>
- <varlistentry>
- <term>str</term>
-
- <listitem>
- <para>文字列.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>c</term>
-
- <listitem>
- <para>文字整数コードのベクトル</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
-
- <refsection>
- <title>説明</title>
-
- <para>
- c(i)がpart(str,i))のScilab整数コードとなるような
- cを返します.</para>
- </refsection>
-
- <refsection>
- <title>例</title>
-
- <programlisting role="example"><![CDATA[
-str2code('Scilab')'
-code2str([-28 12 18 21 10 11])
- ]]></programlisting>
- </refsection>
-
- <refsection role="see also">
- <title>参照</title>
-
- <simplelist type="inline">
- <member><link linkend="code2str">code2str</link></member>
-
- <member><link linkend="ascii">ascii</link></member>
- </simplelist>
- </refsection>
-</refentry>
]]></programlisting>
</refsection>
- <refsection>
- <title>Ver Também</title>
-
- <simplelist type="inline">
- <member><link linkend="code2str">code2str</link></member>
-
- <member><link linkend="str2code">str2code</link></member>
- </simplelist>
- </refsection>
</refentry>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- -->
-<refentry version="5.0-subset Scilab" xml:id="code2str" xml:lang="en"
- xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:ns3="http://www.w3.org/1999/xhtml"
- xmlns:mml="http://www.w3.org/1998/Math/MathML"
- xmlns:db="http://docbook.org/ns/docbook">
- <info>
- <pubdate>$LastChangedDate: 2006-08-08 16:57:13 +0200 (Tue, 08 Aug 2006)
- $</pubdate>
- </info>
-
- <refnamediv>
- <refname>code2str</refname>
-
- <refpurpose>retorna o string associado ao código Scilab
- inteiro</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <title>Seqüência de Chamamento</title>
-
- <synopsis>str=code2str(c)</synopsis>
- </refsynopsisdiv>
-
- <refsection>
- <title>Parâmetros</title>
-
- <variablelist>
- <varlistentry>
- <term>str</term>
-
- <listitem>
- <para>string</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>c</term>
-
- <listitem>
- <para>vetor de códigos de caracteres inteiros</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
-
- <refsection>
- <title>Descrição</title>
-
- <para>Retorna o string associado ao código Scilab inteiro. str é tal que
- c(i) é o código Scilab inteiro de part(str,i))</para>
- </refsection>
-
- <refsection>
- <title>Exemplos</title>
-
- <programlisting role="example"><![CDATA[
-code2str([-28 12 18 21 10 11])
-str2code('Scilab')'
- ]]></programlisting>
- </refsection>
-
- <refsection>
- <title>Ver também</title>
-
- <simplelist type="inline">
- <member><link linkend="str2code">str2code</link></member>
-
- <member><link linkend="ascii">ascii</link></member>
- </simplelist>
- </refsection>
-</refentry>
<title>Exemplos</title>
<programlisting role="example"><![CDATA[
-isascii(code2str(300))
-isascii(code2str(-11))
letters = [115. 99. 105. 108. 97. 98.]
isascii(letters)
ascii(letters)
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA -
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- -->
-<refentry version="5.0-subset Scilab" xml:id="str2code" xml:lang="en"
- xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:ns3="http://www.w3.org/1999/xhtml"
- xmlns:mml="http://www.w3.org/1998/Math/MathML"
- xmlns:db="http://docbook.org/ns/docbook">
- <info>
- <pubdate>$LastChangedDate: 2006-08-08 16:57:13 +0200 (Tue, 08 Aug 2006)
- $</pubdate>
- </info>
-
- <refnamediv>
- <refname>str2code</refname>
-
- <refpurpose>retorna códigos scilab inteiros associados aos caracteres do
- string</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <title>Seqüência de Chamamento</title>
-
- <synopsis>c=str2code(str)</synopsis>
- </refsynopsisdiv>
-
- <refsection>
- <title>Parâmetros</title>
-
- <variablelist>
- <varlistentry>
- <term>str</term>
-
- <listitem>
- <para>um string</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>c</term>
-
- <listitem>
- <para>um vetor de códigos de caracteres inteiros</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsection>
-
- <refsection>
- <title>Descrição</title>
-
- <para>Retorna c tal que c(i) é o código scilab inteiro de
- part(str,i))</para>
- </refsection>
-
- <refsection>
- <title>Exemplos</title>
-
- <programlisting role="example"><![CDATA[
-str2code('Scilab')'
-code2str([-28 12 18 21 10 11])
- ]]></programlisting>
- </refsection>
-
- <refsection>
- <title>Ver Também</title>
-
- <simplelist type="inline">
- <member><link linkend="code2str">code2str</link></member>
-
- <member><link linkend="ascii">ascii</link></member>
- </simplelist>
- </refsection>
-</refentry>
{sci_strtok,"strtok"},
{sci_strspn,"strspn"},
{sci_strtod,"strtod"},
- {sci_regexp,"regexp"}
+ {sci_regexp,"regexp"},
+ {sci_str2code,"_str2code"},
+ {sci_code2str,"_code2str"}
};
/*--------------------------------------------------------------------------*/
int gw_string(void)
#include "code2str.h"
#include "Scierror.h"
#include "freeArrayOfString.h"
+#include "warningmode.h"
+#include "sciprint.h"
/*--------------------------------------------------------------------------*/
int sci_code2str(char *fname,unsigned long fname_len)
{
CheckRhs(1,1);
CheckLhs(1,1);
+ if (strcmp(fname, "code2str") == 0)
+ {
+ if (getWarningMode())
+ {
+ sciprint(_("%s: Feature %s is obsolete.\n"), _("Warning"), fname);
+ sciprint(_("%s: Please use %s instead.\n"), _("Warning"), "ascii");
+ sciprint(_("%s: This feature will be permanently removed in Scilab %s\n\n"), _("Warning"), "5.4.1");
+ }
+ }
+
if (VarType(1) == sci_matrix)
{
int Stack_position = 0;
#include "Scierror.h"
#include "localization.h"
#include "freeArrayOfString.h"
+#include "warningmode.h"
+#include "sciprint.h"
/*----------------------------------------------------------------------------*/
int sci_str2code(char *fname,unsigned long fname_len)
{
CheckRhs(1,1);
CheckLhs(1,1);
+ if (strcmp(fname, "str2code") == 0)
+ {
+ if (getWarningMode())
+ {
+ sciprint(_("%s: Feature %s is obsolete.\n"), _("Warning"), fname);
+ sciprint(_("%s: Please use %s instead.\n"), _("Warning"), "ascii");
+ sciprint(_("%s: This feature will be permanently removed in Scilab %s\n\n"), _("Warning"), "5.4.1");
+ }
+ }
+
if (VarType(1) == sci_strings)
{
char **Input_String = NULL;
<PRIMITIVE gatewayId="21" primitiveId="28" primitiveName="strspn" />
<PRIMITIVE gatewayId="21" primitiveId="29" primitiveName="strtod" />
<PRIMITIVE gatewayId="21" primitiveId="30" primitiveName="regexp" />
+<PRIMITIVE gatewayId="21" primitiveId="31" primitiveName="_str2code" />
+<PRIMITIVE gatewayId="21" primitiveId="32" primitiveName="_code2str" />
+
</GATEWAY>
\ No newline at end of file
// <-- BENCH NB RUN : 1000000 -->
// <-- BENCH START -->
-a = code2str(-(10:35));
+a = _code2str(-(10:35));
// <-- BENCH END -->
text_cat = strcat(text);
// <-- BENCH START -->
-a = str2code(text_cat);
+a = _str2code(text_cat);
// <-- BENCH END -->
BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
for i=1:NB_LOOPS
- r = code2str([-28 12 18 21 10 11]);
+ r = _code2str([-28 12 18 21 10 11]);
clear r;
end
for i=1:NB_LOOPS
- r = isascii(code2str(200:350));
+ r = isascii(ascii(100:250));
clear r;
end
[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
for i=1:NB_LOOPS
- r = str2code('0123456789');
+ r = _str2code('0123456789');
clear r;
end
//===============================
// unit tests code2str
//===============================
-if code2str(10:35)<>'abcdefghijklmnopqrstuvwxyz' then bugmes();quit;end
-if code2str(-(10:35))<>'ABCDEFGHIJKLMNOPQRSTUVWXYZ' then bugmes();quit;end
-if code2str(0:9)<>'0123456789' then bugmes();quit;end
-if code2str([])<>emptystr() then bugmes();quit;end
+if _code2str(10:35)<>'abcdefghijklmnopqrstuvwxyz' then bugmes();quit;end
+if _code2str(-(10:35))<>'ABCDEFGHIJKLMNOPQRSTUVWXYZ' then bugmes();quit;end
+if _code2str(0:9)<>'0123456789' then bugmes();quit;end
+if _code2str([])<>emptystr() then bugmes();quit;end
//===============================
-s = code2str([-28 12 18 21 10 11]);
+s = _code2str([-28 12 18 21 10 11]);
if (s <>'Scilab') then bugmes();quit;end
//===============================
//===============================
// unit tests code2str
//===============================
-if code2str(10:35)<>'abcdefghijklmnopqrstuvwxyz' then pause,end
-if code2str(-(10:35))<>'ABCDEFGHIJKLMNOPQRSTUVWXYZ' then pause,end
-if code2str(0:9)<>'0123456789' then pause,end
-if code2str([])<>emptystr() then pause,end
+if _code2str(10:35)<>'abcdefghijklmnopqrstuvwxyz' then pause,end
+if _code2str(-(10:35))<>'ABCDEFGHIJKLMNOPQRSTUVWXYZ' then pause,end
+if _code2str(0:9)<>'0123456789' then pause,end
+if _code2str([])<>emptystr() then pause,end
//===============================
-s = code2str([-28 12 18 21 10 11]);
+s = _code2str([-28 12 18 21 10 11]);
if (s <>'Scilab') then pause,end
//===============================
// =============================================================================
if or(isascii('This is a sentence')) <> %T then bugmes();quit;end
// =============================================================================
-if isascii(code2str(120)) <> %T then bugmes();quit;end
+if isascii(ascii(20)) <> %T then bugmes();quit;end
// =============================================================================
-if or(isascii(code2str(120:150))) <> %T then bugmes();quit;end
+if or(isascii(ascii(20:50))) <> %T then bugmes();quit;end
// =============================================================================
tab_ref = [
"世界A您好",
// =============================================================================
if or(isascii('This is a sentence')) <> %T then pause,end
// =============================================================================
-if isascii(code2str(120)) <> %T then pause,end
+if isascii(ascii(20)) <> %T then pause,end
// =============================================================================
-if or(isascii(code2str(120:150))) <> %T then pause,end
+if or(isascii(ascii(20:50))) <> %T then pause,end
// =============================================================================
tab_ref = [
"世界A您好",
//===============================
// unit tests str2code
//===============================
-if or(str2code('abcdefghijklmnopqrstuvwxyz')<>(10:35)') then bugmes();quit;end
-if or(str2code('ABCDEFGHIJKLMNOPQRSTUVWXYZ')<>-(10:35)') then bugmes();quit;end
-if or(str2code('0123456789')<>(0:9)') then bugmes();quit;end
-if str2code(emptystr())<>[] then bugmes();quit;end
+if or(_str2code('abcdefghijklmnopqrstuvwxyz')<>(10:35)') then bugmes();quit;end
+if or(_str2code('ABCDEFGHIJKLMNOPQRSTUVWXYZ')<>-(10:35)') then bugmes();quit;end
+if or(_str2code('0123456789')<>(0:9)') then bugmes();quit;end
+if _str2code(emptystr())<>[] then bugmes();quit;end
//===============================
-if str2code('Scilab') <> [-28;12;18;21;10;11] then bugmes();quit;end
+if _str2code('Scilab') <> [-28;12;18;21;10;11] then bugmes();quit;end
//===============================
//===============================
// unit tests str2code
//===============================
-if or(str2code('abcdefghijklmnopqrstuvwxyz')<>(10:35)') then pause,end
-if or(str2code('ABCDEFGHIJKLMNOPQRSTUVWXYZ')<>-(10:35)') then pause,end
-if or(str2code('0123456789')<>(0:9)') then pause,end
-if str2code(emptystr())<>[] then pause,end
+if or(_str2code('abcdefghijklmnopqrstuvwxyz')<>(10:35)') then pause,end
+if or(_str2code('ABCDEFGHIJKLMNOPQRSTUVWXYZ')<>-(10:35)') then pause,end
+if or(_str2code('0123456789')<>(0:9)') then pause,end
+if _str2code(emptystr())<>[] then pause,end
//===============================
-if str2code('Scilab') <> [-28;12;18;21;10;11] then pause,end
+if _str2code('Scilab') <> [-28;12;18;21;10;11] then pause,end
//===============================
//===============================
STRING = ' '+ascii(9)+' '+'S'+' '+ascii(9)+'C'+' '+ascii(9)+'I'+' '+ascii(9)+'L'+' '+ascii(9)+'A'+' '+ascii(9)+'B'+' '+ascii(9)+' ';
//===============================
-R1 = str2code('!'+stripblanks(STRING,%T)+'!');
-W1 = [ 38.; - 28.; 40.; - 40.; - 12.; 40.; - 40.; - 18.; 40.; - 40.; - 21.; 40.; - 40.; - 10.; 40.; - 40.; - 11.; 38];
+R1 = ascii('!'+stripblanks(STRING,%T)+'!');
+W1 = [33. 83. 32. 9. 67. 32. 9. 73. 32. 9. 76. 32. 9. 65. 32. 9. 66. 33.];
if (R1 <> W1) then bugmes();quit;end
//===============================
-R2 = str2code('!'+stripblanks(STRING,%F)+'!');
-W2 = [38.; - 40.; 40.; - 28.; 40.; - 40.; - 12.; 40.; - 40.; - 18.; 40.; - 40.; - 21.; 40.; - 40.; - 10.; 40.; - 40.; - 11.; 40.; - 40.; 38.];
+R2 = ascii('!'+stripblanks(STRING,%F)+'!');
+W2 = [33. 9. 32. 83. 32. 9. 67. 32. 9. 73. 32. 9. 76. 32. 9. 65. 32. 9. 66. 32. 9. 33. ];
if (R2 <> W2) then bugmes();quit;end
// = strings with only blank character =========================================
if(stripblanks("")<>"") then bugmes();quit;end
//===============================
STRING = ' '+ascii(9)+' '+'S'+' '+ascii(9)+'C'+' '+ascii(9)+'I'+' '+ascii(9)+'L'+' '+ascii(9)+'A'+' '+ascii(9)+'B'+' '+ascii(9)+' ';
//===============================
-R1 = str2code('!'+stripblanks(STRING,%T)+'!');
-W1 = [ 38.; - 28.; 40.; - 40.; - 12.; 40.; - 40.; - 18.; 40.; - 40.; - 21.; 40.; - 40.; - 10.; 40.; - 40.; - 11.; 38];
+R1 = ascii('!'+stripblanks(STRING,%T)+'!');
+W1 = [33. 83. 32. 9. 67. 32. 9. 73. 32. 9. 76. 32. 9. 65. 32. 9. 66. 33.];
if (R1 <> W1) then pause,end
//===============================
-R2 = str2code('!'+stripblanks(STRING,%F)+'!');
-W2 = [38.; - 40.; 40.; - 28.; 40.; - 40.; - 12.; 40.; - 40.; - 18.; 40.; - 40.; - 21.; 40.; - 40.; - 10.; 40.; - 40.; - 11.; 40.; - 40.; 38.];
+R2 = ascii('!'+stripblanks(STRING,%F)+'!');
+W2 = [33. 9. 32. 83. 32. 9. 67. 32. 9. 73. 32. 9. 76. 32. 9. 65. 32. 9. 66. 32. 9. 33. ];
if (R2 <> W2) then pause,end
// = strings with only blank character =========================================
tab_mark = ["." "+" "x" "*" "D" "d" "^" "v" "o"]
num_mark = [ 0 1 2 3 4 5 6 7 9 ]
- deff("[b] = is_digit(c)",[ "code = str2code(c)";...
+ deff("[b] = is_digit(c)",[ "code = _str2code(c)";...
"b = 0 <= code & code <= 9" ])
n = length(style)
if n >= 1 then
// ipar(5:4+lfil) ............. character codes for filename
// ipar(5+lfil:4+lfil+lfmt) ... character codes for format if any
//
-// Tip: convert from ASCII to human-readable => code2str(ipar)
+// Tip: convert from ASCII to human-readable => _code2str(ipar)
//
// 2008/03/31 Laurent Vaylet Creation
// YYYY/MM/DD ??? Modification: ???
//-- Retrieve format and convert to human-readable string
ipar = scs_m.objs(idxBlock).model.ipar
-formatStr = code2str(ipar(5+ipar(1):4+ipar(1)+ipar(2)))
+formatStr = _code2str(ipar(5+ipar(1):4+ipar(1)+ipar(2)))
endfunction
//-- Retrieve filename and convert to human-readable string
ipar = scs_m.objs(idxBlock).model.ipar
-filename = code2str(ipar(5:4+ipar(1)))
+filename = _code2str(ipar(5:4+ipar(1)))
endfunction
lfmt = iparIO(2);
//-- Set new filename ...
-iparIO = [iparIO(1:4) ; str2code(newName) ; iparIO(5+lfil:$)];
+iparIO = [iparIO(1:4) ; _str2code(newName) ; iparIO(5+lfil:$)];
//-- ... and new filename length
iparIO(1) = length(newName);
// ipar(5:4+lfil) ............. character codes for filename
// ipar(5+lfil:4+lfil+lfmt) ... character codes for format if any
//
-// Tip: convert from ASCII to human-readable => code2str(ipar)
+// Tip: convert from ASCII to human-readable => _code2str(ipar)
//
// 2008/03/31 Laurent Vaylet Creation
// YYYY/MM/DD ??? Modification: ???
lfmt = ipar(2);
//-- Set new format...
-ipar = [ipar(1:5+lfil-1) ; str2code(formatStr)];
+ipar = [ipar(1:5+lfil-1) ; _str2code(formatStr)];
//-- ... and new format length
ipar(2) = length(formatStr);