Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Convert between text and numbers
Topic Summary:
Created On: 27-Mar-2006 13:42
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Mar-2006 14:57
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

look at intOf, realOf, stringOf and format
Report this to a Moderator Report this to a Moderator
 28-Mar-2006 10:54
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

converting an integer to a string is simply a matter of concatenating it with the empty string
eg
string s = 23 ""
To convert a string to an integer you can use the age old trick of "intOf(realOf("123"))"
or perhaps a simple function as follows: -

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 28-Mar-2006 20:19
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Here's the two library functions I use. I suppose I should write function "fIntOf" that looks like this:

int fIntOf(string InString)
{ // If the InString contains a valid integer then return it; otherwise return -1
int Outint
if (fStringToInt(InString, OutInt))
return(OutInt)
else return(-1)
} // end fIntOf()

- Louie

Edited: 28-Mar-2006 at 20:20 by Louie Landale
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.