How do I subtract from string?

Get help using Construct 2

Post » Tue Jan 20, 2015 9:18 pm

Hi,
i create a program like calculator with C2 but i need to subtract the last number to first if Del button clicked.
in my source i use system every tick to show the textbox value...
please help me,

best regards.
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Tue Jan 20, 2015 9:22 pm

left(string, len(string) - 1)

left() takes the first X characters of your string
len() counts the length of the string

So left(string, len(string) - 1) takes all characters from the first to 1 before the last
B
83
S
22
G
15
Posts: 1,039
Reputation: 15,219

Post » Tue Jan 20, 2015 9:28 pm

Thank you for reply, but i'm new in C2, How ca i use that?
my global variable is : callnumber and it is the textbox value
can i use the : "left(callnumber , len(callnumber ) - 1) " in textbox set text?
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Tue Jan 20, 2015 9:50 pm

OK, I use like that write here and it work, thank you
B
10
S
3
Posts: 180
Reputation: 1,212


Return to How do I....?

Who is online

Users browsing this forum: digitalsoapbox, RetrocadeMedia, tarek2 and 1 guest