April 25, 2019, 12:06:06 PM
Robotforum | Industrial Robots Community

 Copying strings from two-dimensional array

Author Topic:  Copying strings from two-dimensional array  (Read 448 times)

0 Members and 1 Guest are viewing this topic.

August 09, 2018, 03:47:39 PM
Read 448 times
Offline

RoboticsMan


Hello!

Lets assume we have the following code:

Code: [Select]
CHAR STRINGS_1[10,10]
CHAR STRINGS_2[10,10]

STRINGS_1[1,] = "Hello!"

Now I want to copy the string from STRINGS_1[1] to STRINGS_2[5]. How do I do this? I can't make StrLen(STRINGS_1[1,]) work, so I don't know how long the string is. (In this example I do, but otherwise not). This means that I cant iterate like this:

Code: [Select]
FOR COUNTER = 1 TO LENGTH
 STRINGS_2[5, COUNTER] = STRINGS_1[1, COUNTER]
ENDFOR
because I dont know how far to iterate, and trying to copy uninitialized characters will give an error. Also, StrCopy() I also couldn't make work on these two-dimensional arrays.
Any ideas?

Software version is KSS 5.5.10.

Thanks in advance!

/RoboticsMan

Today at 12:06:06 PM
Reply #1

Advertisement

Guest

August 09, 2018, 10:50:48 PM
Reply #1
Offline

panic mode

Global Moderator

Code: [Select]
FOR COUNTER = 1 TO 10
   STRINGS_2[5, COUNTER] = 0
   ON_ERROR_PROCEED
   STRINGS_2[5, COUNTER] = STRINGS_1[1, COUNTER]
ENDFOR
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

August 10, 2018, 06:42:55 AM
Reply #2
Offline

RoboticsMan


Thanks! I'll try that!

Sendt fra min G8441 med Tapatalk



Share via facebook Share via linkedin Share via pinterest Share via reddit Share via twitter

xx
2-dimensional-array to 1-dimensional array

Started by DonDiZZy on Stäubli & Bosch Robot Forum

1 Replies
714 Views
Last post October 27, 2018, 04:26:28 PM
by TygerDawg
xx
Checking current array index and array content

Started by iK!_!KA on KUKA Robot Forum

3 Replies
1031 Views
Last post October 17, 2017, 08:07:44 PM
by panic mode
xx
Move the robot along a complex three-dimensional trajectory

Started by firefly on KUKA Robot Forum

13 Replies
745 Views
Last post December 05, 2018, 09:38:26 AM
by firefly
xx
How to compare strings?

Started by DomoArigato on KUKA Robot Forum

3 Replies
3011 Views
Last post November 14, 2014, 05:12:01 AM
by Fubini