tokenat (-1)

Discussion and feedback on Construct 2

Post » Fri Jan 08, 2016 1:58 am

For the new version would be possible to enter with negative values in tokenat?
eg.
Code: Select all
var company = "PlayLive Google Facebook Youtube"
tokenat(company, -1, " ")
result: Youtube


I have needed to use it in some cases and had to create a huge code to get the result.
*sorry for bad english
Bitcoin Wallet: 1GCRqZExcP6svMdKGpCaRH4A8QAZtSjXxu
B
44
S
18
Posts: 178
Reputation: 3,566

Post » Fri Jan 08, 2016 2:07 am

tokencount(company, " ")
Image ImageImage
B
169
S
50
G
173
Posts: 8,316
Reputation: 110,276

Post » Fri Jan 08, 2016 2:16 pm

Yes, it would be easy to do so but we always have to create a variable to save the text.
Do not like being creating several variables because I can lose myself in the future.

If we do not use variable the code it gets too big.
It is only an idea to try.
Bitcoin Wallet: 1GCRqZExcP6svMdKGpCaRH4A8QAZtSjXxu
B
44
S
18
Posts: 178
Reputation: 3,566

Post » Fri Jan 08, 2016 3:55 pm

There are a lot of cool improvements that could be added to the token commands, but i think they have been abandoned in favour of regex.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 18 guests