Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2008, 09:55:43 PM
Home Help Search Calendar Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Robot Help and Discussion Center
| |-+  KUKA Robots (Moderators: Werner Hampel, kai_n, MartinH)
| | |-+  String manipulation and conversion
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: String manipulation and conversion  (Read 277 times)
Andicot
Newbie
*
Offline Offline

Posts: 25


« on: August 14, 2008, 11:07:32 PM »

There is way to convert integer variable in string and to add a string to a string?
I try to use stradd but is not a function recognized.
The software version is 5.4.
How to use the function for the string manipulation?
Logged
asimo
Full Member
***
Offline Offline

Posts: 174


« Reply #1 on: August 15, 2008, 06:30:18 PM »

StrAdd is working well on 5.4. You probably haven't returned the value in an integer variable (because StrAdd is a function and returns a value, it needs it):

DECL INT result
...
result = StrAdd(foo[], bar[])
« Last Edit: August 15, 2008, 08:26:45 PM by asimo » Logged
asimo
Full Member
***
Offline Offline

Posts: 174


« Reply #2 on: August 15, 2008, 08:26:15 PM »

Sorry, I forgot about the INT to String. You can use SWRITE:

;--------8<--------
DECL INT number
DECL INT offset
DECL STATE_T state
DECL CHAR myText[24]

offset = 0
number = 9 ; The number you want

SWRITE(myText[], state, offset, "%d", number)
;--------8<--------

After that, myText will have you value in a string.
Logged
Andicot
Newbie
*
Offline Offline

Posts: 25


« Reply #3 on: August 16, 2008, 12:23:24 AM »

Thank you, Monday morning i will try
Logged
jgordon
Newbie
*
Offline Offline

Posts: 1


« Reply #4 on: September 29, 2008, 05:41:10 PM »

I need to translate a character array into an integer array.  Is this possible?
I am using software version 7.0 and I only have one array to work with: CHAR COORD[].
Thanks
« Last Edit: September 29, 2008, 05:43:19 PM by jgordon » Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!