File Exchange
Try Origin for Free
The Origin Forum
Home
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
|
Send File to Tech support
Username:
Password:
Save Password
Forgot your Password?
|
Admin Options
All Forums
Origin Forum
Origin Forum
Help: Convert string to int
New Topic
Reply to Topic
Printer Friendly
Author
Topic
hotelbravo
Austria
Posts
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!
cpyang
USA
1406 Posts
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
hotelbravo
Austria
Posts
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
USA
1406 Posts
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
Topic
New Topic
Reply to Topic
Printer Friendly
Jump To:
Select Forum
Origin Forum
Origin Forum
Origin Viewer Forum
Origin Forum for Programming
Forum for Python
LabTalk Forum
Forum for Origin C
Forum for Automation Server/COM and LabVIEW
Origin中文论坛
Origin 中文论坛 (Chinese Origin Forum)
Japanese Origin Forum
Origin日本語フォーラム (Japanese Origin Forum)
Origin on Linux
The Origin on Linux Forum
Private Forums
Distributor Forum
--------------------
Home
Active Topics
Frequently Asked Questions
Member Information
Search Page
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000