CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-04-2002, 11:13 PM
gammeltoft gammeltoft is offline
Junior Member
 
Join Date: Nov 2002
Location: Denmark
Posts: 3
Converting strings to number

Looking for a way to convert a string to a number in a Onespace macro.
By using some command like string-to-number in ME10.

I have a comma-separated file containing:
an x-coordinate
an y-coordinate
and finally an angle (rad).
Like this:
0.12345,0.67685,0.0345
0.12456,0.68745,0.0445
0.12567,0.69984,0.0545
and so on....

I read in the values opening the file and thereafter
uses (read-line file-stream nil 'eof).

All of the values are read into variables but as strings.

Does anyone have some ideas to solve this problem?

Is it possible to read in the values directely in numeric format or
is it possible to convert them later on like in ME10?

Kind Regards
Henrik Gammeltoft
Reply With Quote
  #2  
Old 11-05-2002, 07:13 AM
Markus Markus is offline
Registered User
 
Join Date: Oct 2002
Location: Sindelfingen, Germany
Posts: 88
Hello Henrik,

all you need to do is to use READ instead of READ-LINE. That works just fine because a line like 0,0,0 is a Designer data type: gpnt3d. Please see the Integration Kit documentation titled "Arithmetical and Vector Utilities" for more information.
That way you don't need to convert a string to a number.

Hope this helps.

Markus
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:54 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.