Hi
Does anybody know what the syntax is to convert an integer to a string in the "Build Stage". Function atoi(String to Integer) works but looks like function itoa(Integer to String) is not working.
Example : IntRec = atoi(StringRec) works.
I know it is possible to use other stages to do this, but I want to get it to work in a "Build Stage".
Thanks
Dale
Build Stage Job
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 20
- Joined: Tue May 13, 2008 1:24 am
- Location: Dale Cooper
Hi
I'm trying to convert an integer value to a string or char value.
ex var = 1 (integer) and I want to convert it to a string or char "1", the reason for this is because I then want to reformat it to "01".(Add the 0)
Thanks!
I'm trying to convert an integer value to a string or char value.
ex var = 1 (integer) and I want to convert it to a string or char "1", the reason for this is because I then want to reformat it to "01".(Add the 0)
Thanks!
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 20
- Joined: Tue May 13, 2008 1:24 am
- Location: Dale Cooper
ArndW
what is not working?
In the Build Stage it is possible to use the C function atoi to convert string to integer, but the
opposite function itoa does not work.
Are you assigning the string value as the return value?
Syntax : char * itoa ( int value, char * str, int base );
Tried ReturnValue = itoa(CharValue,buffer,10) where ReturnValue is char. buffer also char.
Try to achieve something like this:
InputValue(char) = "123"
Split the string into 1,2 and 3, convert to integer using atoi and add together to equal 6 (1+2+3)
Now I want to convert the 6(Integer) to a string to append "A" to the 6 to give the result "A6"
I have no idea how to do this using a "Build Stage"?
Should I rather use an External Function Routine?
Thanks
what is not working?
In the Build Stage it is possible to use the C function atoi to convert string to integer, but the
opposite function itoa does not work.
Are you assigning the string value as the return value?
Syntax : char * itoa ( int value, char * str, int base );
Tried ReturnValue = itoa(CharValue,buffer,10) where ReturnValue is char. buffer also char.
Try to achieve something like this:
InputValue(char) = "123"
Split the string into 1,2 and 3, convert to integer using atoi and add together to equal 6 (1+2+3)
Now I want to convert the 6(Integer) to a string to append "A" to the 6 to give the result "A6"
I have no idea how to do this using a "Build Stage"?
Should I rather use an External Function Routine?
Thanks