<div dir='ltr'>
thanks serge ,<br>i have one more question,<br>i wrote a vb.net application, that give this output from a xml file <br>BHCurve=tlist(['BHCurve';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point']);<br>BHCurve.Point=tlist(['Point';'B';'H'],0,0);<br>BHCurve.Point=tlist(['Point';'B';'H'],0.05,32);<br>BHCurve.Point=tlist(['Point';'B';'H'],0.1,55);<br>BHCurve.Point=tlist(['Point';'B';'H'],0.15,71);<br>BHCurve.Point=tlist(['Point';'B';'H'],0.2,82);<br>BHCurve.Point=tlist(['Point';'B';'H'],0.25,90);<br>BHCurve.Point=tlist(['Point';'B';'H'],0.3,96);<br>BHCurve.Point=tlist(['Point';'B';'H'],0.35,101.5);<br><br>Now i want to make a a helplist function in scilab, that i can load in vb.net with the exec('Fullpath\function.sci');<br>for example <br>function[]= zlist(argument)<br>zlist(str);<br>ztlist = tlist(['Typ';]) // empty tlist<br>ztlist(1)(2:size(argument(1,2))<br>finally the output will change <br>BHCurve=ztlist(['BHCurve';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point';'Point']);<br>BHCurve.Point=ztlist(['Point';'B';'H'],0,0);<br>BHCurve.Point=ztlist(['Point';'B';'H'],0.05,32);<br>BHCurve.Point=ztlist(['Point';'B';'H'],0.1,55);.........<br>Can you understand what i want ??<br>thank you for you help<br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Tue, 8 Jan 2013 08:20:22 -0800<br>From: <a href="/user/SendEmail.jtp?type=node&node=4025630&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a><br>To: <a href="/user/SendEmail.jtp?type=node&node=4025630&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a><br>Subject: Re: Dot Notation<br><br>
<div class="ecxmoz-cite-prefix">Le 08/01/2013 10:03, samy a écrit :<br>
</div>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:BAY172-W299A406A48B751E2A1D89D7240@phx.gbl">
<div dir="ltr">
hi serge,<br>
the example work fine, but i have a question can you <span id="ecxresult_box" class="ecxshort_text" lang="en"><span class="ecxhps">explain</span>
<span class="ecxhps">the individual steps</span></span>.<br>
i understand what the code do, but <span id="ecxresult_box" class="ecxshort_text" lang="en"><span class="ecxhps ecxalt-edited">not
completely.<br>
thanks.<br>
</span></span><br>
<div>
<hr id="ecxstopSpelling"><br>
<div class="ecxmoz-cite-prefix"><b> </b><b>digits=string(0:9);</b><b><br>
</b><b>txt=stripblanks(mgetl('your file'));</b><b> //read
the file and remove the leading and trailing blanks of
each line<br>
</b><b>txt(txt=='')=[]; //remove blank lines</b><b><br>
</b><b>n=size(txt,1); //the number of lines</b><b><br>
</b><b>I=[];</b><b><br>
</b><b>for k=1:n</b><b> //loop on each line <br>
</b><b> t=tokens(txt(k),"=");</b><b><br>
</b></div>
</div>
</div>
</blockquote>
<b>//if txt(k) contains something like </b>ASY.Pr.VER = 2.0 the
variable t will be equal to ["ASY.Pr.VER","2.0"]
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:BAY172-W299A406A48B751E2A1D89D7240@phx.gbl">
<div dir="ltr">
<div>
<div class="ecxmoz-cite-prefix"><b> </b><b> if size(t,'*')==2
then</b><b> //there is an = sign in the line<br>
</b><b> t2=stripblanks(t(2));</b><b><br>
</b><b> if or(part(t2,1)==digits) then</b><b> //check if
the first character of t(2) is a digit<br>
</b></div>
</div>
</div>
</blockquote>
<b>//t2 begins with a digit, I assume t2 contains the representation
of a number , the associated line is not modified</b><br>
//because ASY.Pr.VER = 2.0 is a valid Scilab instruction<br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:BAY172-W299A406A48B751E2A1D89D7240@phx.gbl">
<div dir="ltr">
<div>
<div class="ecxmoz-cite-prefix"><b> </b><b> I=[I;txt(k)];</b><b><br>
</b><b> else</b><b><br>
</b></div>
</div>
</div>
</blockquote>
<b>//t2 does not represent a numbe, expression like ASY.Pr.NAME=
Samy is not a valid Scilab instrution<br>
// (at least is Samy is not a defined variable)<br>
//such lines are transformed into </b><b><b>ASY.Pr.NAME= "Samy"</b><br>
</b>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:BAY172-W299A406A48B751E2A1D89D7240@phx.gbl">
<div dir="ltr">
<div>
<div class="ecxmoz-cite-prefix"><b> </b><b>
I=[I;t(1)+"="""+t2+""""];</b><b><br>
</b><b> end</b><b><br>
</b><b> else</b><b><br>
</b></div>
</div>
</div>
</blockquote>
<b>//if txt(k) does not contains an = sign, like </b><b><b>ASY.Pr.LOG
</b></b>this does not represent an assignment<br>
<b>//such lines are transformed into </b><b><b>ASY.Pr.LOG= [] (empty
matrix assigned to </b></b><b><b>ASY.Pr.LOG)</b></b>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:BAY172-W299A406A48B751E2A1D89D7240@phx.gbl">
<div dir="ltr">
<div>
<div class="ecxmoz-cite-prefix"><b> </b><b>
I=[I;txt(k)+"=[]"];</b><b><br>
</b><b> end</b><b><br>
</b><b>end</b><b><br>
</b><b>clear ASY</b><b><br>
</b></div>
</div>
</div>
</blockquote>
<b>//here I contains a sequence of valid Scilab instruction</b>s
that can be used to defined a struct<br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:BAY172-W299A406A48B751E2A1D89D7240@phx.gbl">
<div dir="ltr">
<div>
<div class="ecxmoz-cite-prefix"><b> </b><b>execstr(I)</b><b>
//evaluate it <br>
</b><b>//here ASY is a struct with one field named Pr and
ASY.Pr is a struct</b><b><br>
</b><b>ASY.Pr</b><b><br>
</b><br>
<br>
Serge Steer<br>
<br>
Le 03/01/2013 09:35, samy a écrit :<br>
</div>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:1357202109323-4025607.post@n3.nabble.com">
<pre>Hello everyone,
i want to read a text file with the following Output:
ASY.Pr.VER = 2.0
ASY.Pr.NAME = Samy
ASY.Pr.REKE = XY
ASY.Pr.LOG
and give it as a tlist in scilab for example
tlist(['Pr,'VER','NAME','REKE','LOG'],2.0,Samy, XY)
it's possible?
i have a large file
I thank you in advance for any help.
--
View this message in context: <a class="ecxmoz-txt-link-freetext" href="http://mailinglists.scilab.org/Dot-Notation-tp4025607.html" rel="nofollow" target="_blank" link="external">http://mailinglists.scilab.org/Dot-Notation-tp4025607.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
<a href="http:///user/SendEmail.jtp?type=node&node=4025609&i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users" rel="nofollow" target="_blank" link="external">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
_______________________________________________
<br>
users mailing list
<br>
<a href="http:///user/SendEmail.jtp?type=node&node=4025609&i=1" rel="nofollow" target="_blank" link="external">[hidden
email]</a>
<br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="nofollow" target="_blank" link="external">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br>
<br>
<hr color="#cccccc" size="1">
<div style="color:#444;font:12px\00000d\00000a tahoma,geneva,helvetica,arial,sans-serif">
<div style="font-weight:bold">If you reply to this email,
your message will be added to the discussion below:</div>
<a href="http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025609.html" rel="nofollow" target="_blank" link="external">http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025609.html</a>
</div>
<div style="color:#666;font:11px\00000d\00000a tahoma,geneva,helvetica,arial,sans-serif;line-height:1.5em">
To unsubscribe from Dot Notation, <a rel="nofollow" target="_blank" link="external">click
here</a>.<br>
<a href="http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble:email.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble:email.naml-instant_emails%21nabble:email.naml-send_instant_email%21nabble:email.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a> </div>
</div>
</div>
<br>
<hr align="left" width="300">
View this message in context: <a href="http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025626.html" rel="nofollow" target="_blank" link="external">RE:
Dot Notation</a><br>
Sent from the <a href="http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html" rel="nofollow" target="_blank" link="external">Scilab
users - Mailing Lists Archives mailing list archive</a> at
Nabble.com.<br>
<br>
<fieldset class="ecxmimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
users mailing list
<a href="http:///user/SendEmail.jtp?type=node&node=4025628&i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users" rel="nofollow" target="_blank" link="external">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>_______________________________________________
<br>users mailing list
<br><a href="http:///user/SendEmail.jtp?type=node&node=4025628&i=1" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<br><a href="http://lists.scilab.org/mailman/listinfo/users" rel="nofollow" target="_blank" link="external">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br>
<br>
<hr color="#cccccc" size="1">
<div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
<div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
<a href="http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025628.html" target="_blank" rel="nofollow" link="external">http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025628.html</a>
</div>
<div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;line-height:1.5em">
To unsubscribe from Dot Notation, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
<a href="http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble:email.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble:email.naml-instant_emails%21nabble:email.naml-send_instant_email%21nabble:email.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
</div></div> </div>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025630.html">RE: Dot Notation</a><br/>
Sent from the <a href="http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html">Scilab users - Mailing Lists Archives mailing list archive</a> at Nabble.com.<br/>