Hi Edward,

Thanks very much, ExpressionToToken does the job.

Kevin



On Sat, 23 Apr 2005, Edward A. Lee wrote:

| Date: Sat, 23 Apr 2005 09:28:21 -0700
| From: Edward A. Lee <[EMAIL PROTECTED]>
| To: Kevin Tang <[EMAIL PROTECTED]>
| Cc: ptolemy-hackers <ptolemy-hackers@eecs.berkeley.edu>
| Subject: Re: StringToken to Number
| 
| 
| You could use the ExpressionToToken actor, in the Conversions library.
| You may need to set the output type of the actor, which you can do
| in the port configurer dialog.
| 
| Edward
| 
| At 12:38 AM 4/23/2005 -0400, Kevin Tang wrote:
| >Hi Hackers,
| >
| >I have a basic question.  How can a StringToken be converted to an
| >IntToken or a DoubleToken?  I'm assuming that it is possible with existing
| >Ptolemy elements, but I haven't found a way.  I tried using the Array and
| >Conversions actor libraries without success, and did not see suitable
| >functionality for this task in the Ptolemy Expression Language
| >documentation.  I may have missed something.
| >
| >I am passing string messages between composite actors and would like to
| >parse a substring of that message as a number.  (e.g.  For "ABC_123" I
| >would like to convert "123" as a number I can do math with.)
| >
| >Thanks in advance for any pointers you can share.
| >
| >Kevin
| >
| >
| >
| >
| >----------------------------------------------------------------------------
| >Posted to the ptolemy-hackers mailing list.  Please send administrative
| >mail for this list to: [EMAIL PROTECTED]
| 
| ------------
| Edward A. Lee
| Professor, Chair of the EE Division, Associate Chair of EECS
| 231 Cory Hall, UC Berkeley, Berkeley, CA 94720
| phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
| [EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal  
| 
| 
| ----------------------------------------------------------------------------
| Posted to the ptolemy-hackers mailing list.  Please send administrative
| mail for this list to: [EMAIL PROTECTED]
| 


----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to