Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!usc!zaphod.mps.ohio-state.edu!mips!apple!well!svc From: svc@well.sf.ca.us (Leonard Rosenthol) Newsgroups: comp.sys.mac Subject: MicroPhone Scripting (was Re: ) Summary: Here is your problem! Message-ID: <16381@well.sf.ca.us> Date: 25 Feb 90 02:58:16 GMT References: <6408.25e516f9@pbs.uucp> Reply-To: svc@well.UUCP (Leonard Rosenthol) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 41 In article <6408.25e516f9@pbs.uucp> pcrable@pbs.uucp ( VAX WIZZ) writes: > >I just got Microphone II version 3.0 for my Mac. I'm having problems >in a script capturing incoming text into either variables or a file. >Here's the script... > > Send Text String "'MLS,ALL,ACTIVE^M^J'" > Set Variable * msgs from Expression "0" > While Expression "msgs < 5" > Set Variable * buf[msgs] from Expression "TheLine( CURSORROW )" > Set Variable * msgs from Expression "msgs+1" > Send Text String "'^F'" > End While > Send Text String "'^C'" > [other stuff deleted as it was not part of problem] > Your problem is a misunderstanding of MicroPhone's looping constructs. As it says on page 302 of the reference manual, "The WHILE construct is 'static' in that it does not move characters from the serial port to the terminal window. It should not be used to check for test strings as data is being recieved, but only once data transmission is halted. To test dynamic conditiions, such as new data as it streams in to the terminal window, use either the WAIT or the WHEN commands'. Since what you are trying to accomplish is, as best I can determine, to fill the array buff with the list of messages you should probably use the WHEN contruct to perform the test for completion of the messages. Also in order to get the data, it might be best to capture them into a file (Capture On, Capture Off) and then read the data back out of the file into the array. This is how our sample scripts handle mail, and it works just fine. If you have other questions, please feel free to ask here, or via EMail anid I will be more than glad to help you out. Leonard Rosenthol Software Ventures MicroPhone II Development Team -- +--------------------------------------------------+ Leonard Rosenthol | GEnie : MACgician Lazerware, inc. | MacNet: MACgician UUCP: svc@well.UUCP | ALink : D0025