Insert String without using Left() and Right()

For questions about using Classic.

Post » Wed Feb 22, 2012 3:22 am

Is there any way of inserting a string into a string variable at a defined place in the text, an index maybe, without having to set the text to left(stringName, stringLength) & "addition" & rigth(stringName, stringLength)?
I don't want the CPU to count the right side of the string over and over again, which is what I am doing right now, with a lot of different strings at the same time and GetToken(), with an increasing index position going over 2000.

I have events checking for and reading the current index position in a string, and if a certain string is given, do something according to that string at that position.
About 3 Events for this keep checking every tick and for multiple (about 10) strings at the same time each tick.
With increasing index value in GetToken the FPS breaks in.

My idea was then to just after maybe every 500 Tokens (index 500), add a NewLine, and restart the index to 1, and keep reading the text in the New Line, starting from index 1.Shindoh2012-02-22 03:32:03
Posts: 70
Reputation: 765

Post » Wed Feb 22, 2012 3:43 am

Might want to think about using a different object.

Data-structures is pretty useful.newt2012-02-22 03:43:48
Image ImageImage
Posts: 7,954
Reputation: 91,874

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests