<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>The problem occurs because Pd has several built-in message types, and the float message is one of them.&nbsp; </DIV>
<DIV>Pd expects any message&nbsp;that has the&nbsp;"float" selector to have one argument, and that argument should be a </DIV>
<DIV>float-atom (e.g., "float 1").&nbsp; So if you type "float foo" in a message box and click it,&nbsp;Pd complains about </DIV>
<DIV>"bad arguments" because&nbsp;(I think) when the message box tries to parse the message, it sees the "float" </DIV>
<DIV>selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."</DIV>
<DIV>&nbsp;</DIV>
<DIV>In your example patch, if you disconnect all the objects from the outlet of [textfile] and click </DIV>
<DIV>the [bng], you'll notice that you don't get an error.&nbsp; I would take this to mean that [textfile] does its </DIV>
<DIV>job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting </DIV>
<DIV>[textfile]'s outlet to another object,&nbsp;Pd will catch the badly formed message and report an error.</DIV>
<DIV>&nbsp;</DIV>
<DIV>(On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be </DIV>
<DIV>the right type of atom, so Pd would just silently truncate </DIV>
<DIV>everything after the first argument.&nbsp; But you'd still get an error from the </DIV>
<DIV>right inlet of [select float] because, ironically, by making the first argument of [select] the word</DIV>
<DIV>"float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol </DIV>
<DIV>messages&nbsp;and not&nbsp;floats.)</DIV>
<DIV>&nbsp;</DIV>
<DIV>As far as a solution, you could begin each line of your text file with the selector "list", or a word that </DIV>
<DIV>is not the selector of Pd's builtin messages.&nbsp; If you're reading in arbitrary data and you can't control </DIV>
<DIV>whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure </DIV>
<DIV>what the best solution is.</DIV>
<DIV>&nbsp;</DIV>
<DIV>-Jonathan</DIV>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Pedro Lopes &lt;pedro.lopes@ist.utl.pt&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> matohawk &lt;matohawk@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> pd-list &lt;Pd-list@iem.at&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tue, June 29, 2010 6:49:44 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [PD] Problem with Textfile and line with float<BR></FONT><BR>humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that. <BR><BR>
<DIV class=gmail_quote>On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <SPAN dir=ltr>&lt;<A href="mailto:pedro.lopes@ist.utl.pt" rel=nofollow target=_blank ymailto="mailto:pedro.lopes@ist.utl.pt">pedro.lopes@ist.utl.pt</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>I did that, but what are you expecting your patch to do? <BR>Should it send each object read from text file separately? <BR><BR>'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.<BR><BR>I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)<BR><BR>Best of luck,<BR><FONT color=#888888>Pedro</FONT> 
<DIV>
<DIV></DIV>
<DIV class=h5><BR><BR>
<DIV class=gmail_quote>On Tue, Jun 29, 2010 at 11:36 PM, matohawk <SPAN dir=ltr>&lt;<A href="mailto:matohawk@gmail.com" rel=nofollow target=_blank ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>Hi Pedro,<BR>Sorry I think I'm not very with explanation.<BR>I know how textfile works it's not my problem<BR>Have a look of this patch and textfile, it's better to understand the problem:<BR>http://www.th-th.fr/DOCS/Patch/bug-texfile.pd<BR>http://www.th-th.fr/DOCS/Patch/text-float.txt<BR><BR>Download the twho files, open the patch and click on bang<BR><BR>Cheers,<BR>Thomas<BR><BR>Pedro Lopes a écrit :<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>
<DIV>I'm not following the "concept" behind your code.<BR><BR>Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.<BR><BR>[read your-file.txt]<BR>| &nbsp; [print( &nbsp;&lt;-- this is a message<BR>| /<BR>|/<BR>| &nbsp;[bang] &lt;-- hit this to read,.<BR>| /<BR>|/<BR>[textfile]<BR>|<BR>|<BR>[print list]<BR><BR>And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)<BR><BR>Best of luck,<BR>Pedro<BR>p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.<BR><BR></DIV>
<DIV>On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery &lt;<A href="mailto:matohawk@gmail.com" rel=nofollow target=_blank ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A> &lt;mailto:<A href="mailto:matohawk@gmail.com" rel=nofollow target=_blank ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A>&gt;&gt; wrote:<BR><BR>&nbsp; &nbsp;Hi pd-list,<BR><BR>&nbsp; &nbsp;test this patch, I saw a curious problem. I need to read line with<BR>&nbsp; &nbsp;"float" at the begining of a line and textfile can't do this.<BR>&nbsp; &nbsp;It's a pity<BR><BR>&nbsp; &nbsp;-- &nbsp; &nbsp; Matohawk alias Th-Th<BR></DIV>&nbsp; &nbsp;<A href="http://www.th-th.fr/" rel=nofollow target=_blank>www.th-th.fr</A> &lt;http://www.th-th.fr&gt;<BR><BR>&nbsp; &nbsp;_______________________________________________<BR>&nbsp; &nbsp;<A href="mailto:Pd-list@iem.at" rel=nofollow target=_blank ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A> &lt;mailto:<A
 href="mailto:Pd-list@iem.at" rel=nofollow target=_blank ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A>&gt; mailing list 
<DIV><BR>&nbsp; &nbsp;UNSUBSCRIBE and account-management -&gt;<BR>&nbsp; &nbsp;http://lists.puredata.info/listinfo/pd-list<BR><BR><BR><BR><BR>-- <BR>Pedro Lopes<BR></DIV>contacto: <A href="mailto:jazz@radiozero.pt" rel=nofollow target=_blank ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A> &lt;mailto:<A href="mailto:jazz@radiozero.pt" rel=nofollow target=_blank ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A>&gt; 
<DIV><BR>website: http://web.ist.utl.pt/Pedro.Lopes<BR></DIV></BLOCKQUOTE><BR>
<DIV>
<DIV></DIV>
<DIV><BR>_______________________________________________<BR><A href="mailto:Pd-list@iem.at" rel=nofollow target=_blank ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A> mailing list<BR>UNSUBSCRIBE and account-management -&gt; <A href="http://lists.puredata.info/listinfo/pd-list" rel=nofollow target=_blank>http://lists.puredata.info/listinfo/pd-list</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>Pedro Lopes<BR>contacto: <A href="mailto:jazz@radiozero.pt" rel=nofollow target=_blank ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A><BR></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>website: <A href="http://web.ist.utl.pt/Pedro.Lopes" rel=nofollow target=_blank>http://web.ist.utl.pt/Pedro.Lopes</A> <BR></DIV></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>Pedro Lopes<BR>contacto: <A href="mailto:jazz@radiozero.pt" rel=nofollow target=_blank ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A><BR>website: <A href="http://web.ist.utl.pt/Pedro.Lopes" rel=nofollow target=_blank>http://web.ist.utl.pt/Pedro.Lopes</A> <BR></DIV></DIV></div><br>







      </body></html>