<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>None of the [list] objects will work either, for the reasons I wrote below. For an example of what I'm </DIV>
<DIV>saying, open text-float.txt, add the word "list" at the beginning and save it. Then you will see that your </DIV>
<DIV>patch works.</DIV>
<DIV> </DIV>
<DIV>If anyone knows of an external that works like [textfile] but outputs each line as a list, that would solve your problem.</DIV>
<DIV> </DIV>
<DIV>-Jonathan</DIV>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 10pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> matohawk <matohawk@gmail.com><BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> pd-list <Pd-list@iem.at><BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wed, June 30, 2010 3:58:56 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [PD] Problem with Textfile and line with float<BR></FONT><BR>Hi Jonathan,<BR><BR>Yes I know textfile "works" but I can't put any kind of object behind this Texfile.<BR><BR>I'll try all list object and this the same problem.<BR>Look this :<BR>http://www.th-th.fr/DOCS/Patch/bug-texfile.pd<BR><BR><BR>I need to read this line with float at the begining but I can't.<BR>So I think we will take a script to do this because textfile can't do this.<BR><BR>Thanks for your help<BR>Thomas<BR><BR><BR>Jonathan Wilkes a écrit :<BR>> The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any
message that has the "float" selector to have one argument, and that argument should be a<BR>> float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about<BR>> "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float"<BR>> selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."<BR>> In your example patch, if you disconnect all the objects from the outlet of [textfile] and click<BR>> the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its<BR>> job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting<BR>> [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error.<BR>> (On the other hand, if your example text file had the line "float 3 0 1 2," the
first argument ("3") would be<BR>> the right type of atom, so Pd would just silently truncate<BR>> everything after the first argument. But you'd still get an error from the<BR>> right inlet of [select float] because, ironically, by making the first argument of [select] the word<BR>> "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol<BR>> messages and not floats.)<BR>> As far as a solution, you could begin each line of your text file with the selector "list", or a word that<BR>> is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control<BR>> whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure<BR>> what the best solution is.<BR>> -Jonathan<BR>> <BR>> ------------------------------------------------------------------------<BR>> *From:* Pedro
Lopes <<A href="mailto:pedro.lopes@ist.utl.pt" ymailto="mailto:pedro.lopes@ist.utl.pt">pedro.lopes@ist.utl.pt</A>><BR>> *To:* matohawk <<A href="mailto:matohawk@gmail.com" ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A>><BR>> *Cc:* pd-list <<A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A>><BR>> *Sent:* Tue, June 29, 2010 6:49:44 PM<BR>> *Subject:* Re: [PD] Problem with Textfile and line with float<BR>> <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>> On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <<A href="mailto:pedro.lopes@ist.utl.pt" ymailto="mailto:pedro.lopes@ist.utl.pt">pedro.lopes@ist.utl.pt</A> <mailto:<A href="mailto:pedro.lopes@ist.utl.pt" ymailto="mailto:pedro.lopes@ist.utl.pt">pedro.lopes@ist.utl.pt</A>>>
wrote:<BR>> <BR>> 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<BR>> textfile reads your file and outputs all the values to a [print<BR>> 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<BR>> you intend, but its probably less ambiguous if you explain the<BR>> purpose. :)<BR>> <BR>> Best of luck,<BR>> Pedro<BR>> <BR>> <BR>> On Tue, Jun 29, 2010 at 11:36 PM, matohawk <<A href="mailto:matohawk@gmail.com" ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A><BR>> <mailto:<A
href="mailto:matohawk@gmail.com" ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A>>> wrote:<BR>> <BR>> 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<BR>> understand the problem:<BR>> <A href="http://www.th-th.fr/DOCS/Patch/bug-texfile.pd" target=_blank>http://www.th-th.fr/DOCS/Patch/bug-texfile.pd</A><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>> <BR>> I'm not following the "concept" behind your code.<BR>> <BR>> Notice that you can connect a message box "print" and send<BR>> that command to textfile. And it reads your file to the pd<BR>> shell correctly.<BR>> <BR>> [read your-file.txt]<BR>> | [print( <-- this is a message<BR>> | /<BR>> |/<BR>> | [bang] <-- 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<BR>> use it. I hope I'm understanding your issue, if not,<BR>> hopefully someone does :)<BR>> <BR>> Best of luck,<BR>> Pedro<BR>> p.s: remember to use the "rewind" message to textfile,<BR>> because otherwise it doesn't read the line again! Because it<BR>> moves forward with the seek file pointer.<BR>> <BR>> On Tue, Jun 29, 2010 at 10:37 PM, thomas
thiery<BR>> <<A href="mailto:matohawk@gmail.com" ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A> <mailto:<A href="mailto:matohawk@gmail.com" ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A>><BR>> <mailto:<A href="mailto:matohawk@gmail.com" ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A> <mailto:<A href="mailto:matohawk@gmail.com" ymailto="mailto:matohawk@gmail.com">matohawk@gmail.com</A>>>> wrote:<BR>> <BR>> Hi pd-list,<BR>> <BR>> test this patch, I saw a curious problem. I need to read<BR>> line with<BR>> "float" at the begining of a line and textfile can't do this.<BR>>
It's a pity<BR>> <BR>> -- Matohawk alias Th-Th<BR>> <A href="http://www.th-th.fr/" target=_blank>www.th-th.fr</A> <http://www.th-th.fr/> <http://www.th-th.fr><BR>> <BR>> _______________________________________________<BR>> <A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A> <mailto:<A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A>><BR>> <mailto:<A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A> <mailto:<A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A>>> mailing
list<BR>> <BR>> UNSUBSCRIBE and account-management -><BR>> http://lists.puredata.info/listinfo/pd-list<BR>> <BR>> <BR>> <BR>> <BR>> -- Pedro Lopes<BR>> contacto: <A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A> <mailto:<A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A>><BR>> <mailto:<A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A> <mailto:<A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A>>><BR>> <BR>> website:
http://web.ist.utl.pt/Pedro.Lopes<BR>> <BR>> <BR>> <BR>> _______________________________________________<BR>> <A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A> <mailto:<A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A>> mailing list<BR>> UNSUBSCRIBE and account-management -><BR>> <A href="http://lists.puredata.info/listinfo/pd-list" target=_blank>http://lists.puredata.info/listinfo/pd-list</A><BR>> <BR>> <BR>> <BR>> <BR>> -- Pedro Lopes<BR>> contacto: <A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A> <mailto:<A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A>><BR>> website: <A
href="http://web.ist.utl.pt/Pedro.Lopes" target=_blank>http://web.ist.utl.pt/Pedro.Lopes</A><BR>> <BR>> <BR>> <BR>> <BR>> -- Pedro Lopes<BR>> contacto: <A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A> <mailto:<A href="mailto:jazz@radiozero.pt" ymailto="mailto:jazz@radiozero.pt">jazz@radiozero.pt</A>><BR>> website: <A href="http://web.ist.utl.pt/Pedro.Lopes" target=_blank>http://web.ist.utl.pt/Pedro.Lopes</A><BR>> <BR><BR><BR>_______________________________________________<BR><A href="mailto:Pd-list@iem.at" ymailto="mailto:Pd-list@iem.at">Pd-list@iem.at</A> mailing list<BR>UNSUBSCRIBE and account-management -> <A href="http://lists.puredata.info/listinfo/pd-list" target=_blank>http://lists.puredata.info/listinfo/pd-list</A><BR></DIV></DIV></div><br>
</body></html>