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
35
S
15
Posts: 145
Reputation: 2,971

Post » Fri Jan 08, 2016 2:07 am

tokencount(company, " ")
Image ImageImage
B
164
S
49
G
138
Posts: 7,962
Reputation: 91,890

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
35
S
15
Posts: 145
Reputation: 2,971

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
40
S
21
G
19
Posts: 680
Reputation: 11,180


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests