The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Help: Convert string to int

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
hotelbravo Posted - 12/28/2007 : 1:24:27 PM
Hello everybody,

can somebody please help me with following problem:

I just want to convert a string, which contains some numbers, to an integer or double.

I'm afraid, but I do not know how to manage this. I've already searched in the help and in this forum, but results were negative...


Thanks to all who help me!
3   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 01/02/2008 : 1:59:55 PM
LabTalk assignment will directly convert literal string into value. So basically it is a matter of how to convert a LT string variable into a literal, which can be done by the %( ) substitution, see below:




string a$=100;int b=%(a$);b=;






CP

hotelbravo Posted - 01/02/2008 : 12:52:13 PM
oh sorry, I am programming in Labtalk, not in Origin C. Is therefore any command to convert a string to int or double?

for example: string a = 100 should be convert to integer
cpyang Posted - 12/28/2007 : 2:41:04 PM
I assume you are talking about Origin C?

atoi to convert to int
atof to convert to double

CP



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000