How do I use left() properly?

Get help using Construct 2

Post » Tue Apr 21, 2015 2:50 pm

Hi, I would like to read the first character from a string and use the left() function:

Function.Call(left(system_msg.Text, 1)) but for some reason it outputs always "0" ... any idea what could be my mistake here?
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Tue Apr 21, 2015 3:04 pm

In what way are you trying to use this : Function.Call(left(system_msg.Text, 1))

Could you share the events?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Apr 21, 2015 3:14 pm

Message: Fireche can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
http://prntscr.com/6wh735

system_msg is something like "3<script.........blablabla" and I just want to read the 3 in the beginning.
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Tue Apr 21, 2015 3:18 pm

set text = left(system_msg.Text, 1)

should be enough..
Don't know where the function.call came from.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Apr 21, 2015 3:45 pm

that worked. I thought calling the function only works with Function.call().
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Tue Apr 21, 2015 3:51 pm

you dont need 2 times to set text...just

set Text to............................................................left(AJAX.LastData,1)
Image
B
65
S
23
G
7
Posts: 1,501
Reputation: 10,888

Post » Tue Apr 21, 2015 8:36 pm

korbaach wrote:you dont need 2 times to set text...just

set Text to............................................................left(AJAX.LastData,1)


i know..but..im a programmer and i like to ahve things seperated :D
B
12
S
3
Posts: 211
Reputation: 1,477


Return to How do I....?

Who is online

Users browsing this forum: facecrime and 25 guests