count letters, get a number

For questions about using Classic.

Post » Fri Nov 05, 2010 1:24 pm

hey all,

i have a little question and i can't figure it out myself how to do it
here it comes 8)

I have two names e.g. "michael" and "Michelle"
now i want construct to count the letter but not in a normal way but more like this
m = 2, i = 2, c = 2, h = 2, a = 1, e = 3, l = 3
so that it would sum it up like this:
2-2-2-2-1-3-3
And then (i don't now if it is possible but i still ask it :) ) i want it to count the number up like this
2-2-2-2-1-3-3
first + last, so you get 5 and again 5 and then 3 and last the 2
so you will get this
2-2-2-2-1-3-3
5-5-3-2
7-8
78

So that in the end i will have two numbers, i know it seems a little hard and that's why i don't know how to do it, and i need a little push in the good direction so i know were to start.

If someone can help me out with this i will be very gratefull ;)


(my english isn't that good so there can be a few mistakes in my question)
B
1
G
2
Posts: 4
Reputation: 633

Post » Fri Nov 05, 2010 3:35 pm

In order to do this you should have a close look at the following wiki page:

[size=150:2ygk8u8m]SYSTEM EXPRESSIONS[/size:2ygk8u8m]

That would be the needed push in the right direction for you. :P

Other than that I made a cap which does what you requested. Enter a name in the editbox and click the calculate button. For the letters you had in your example I assigned the same values. So calculating "Michael" will indeed give 78.

Here's the link: [url:2ygk8u8m]http://dl.dropbox.com/u/2306601/namevalthing.cap[/url:2ygk8u8m]

And my further approach to this is to EXPLAIN NOTHING else about it. You go figure it out. That should make for about the best possible learning experience. 8)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Nov 05, 2010 5:21 pm

thanks for the quick reply and thanks for the right push :P
first i will look at the wiki page and if i still can't get to it i will use your example ;)
edit:
Well i took a quick look at your example and i realize i explained my idea wrong i think, what my idea was is that you have Two names in different editboxes, and that it counts how much each letter is used,
E.g.
Michael Michelle
m is used 2 times, the i 2 times etc.
but with your example i can look more in depth of how to keep counting till there are two numbers left
B
1
G
2
Posts: 4
Reputation: 633

Post » Fri Nov 05, 2010 5:50 pm

[quote="maikyy":9jxnj1mv]edit:
Well i took a quick look at your example and i realize i explained my idea wrong i think, what my idea was is that you have Two names in different editboxes, and that it counts how much each letter is used,
E.g.
Michael Michelle
m is used 2 times, the i 2 times etc.
but with your example i can look more in depth of how to keep counting till there are two numbers left[/quote:9jxnj1mv]

Well yeah, you only provided an example for one name, so that's what I based my cap on. Once you understand it you can adapt the method to handle as many names as you like though. :wink:
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest