Skip to first unread message

dank...@gmail.com

unread,
May 19, 2014, 7:09:51 PM5/19/14
to mitappinv...@googlegroups.com

Hello.

What is the command to capitalize only the first letter of each word entered into a text field?

Thank you.

SteveJG

unread,
May 19, 2014, 9:25:38 PM5/19/14
to
possibly  (in pseudo code)       if length textbox1.text = 1 then upcase textbox1.text

that gives you the first word typed.    to get successive 'first' letters, you may have to keep track of the spaces and write a routine to capitalize the first letter after a space.

try it, it might work.  Did it work?

regards,
Steve

Abraham Getzler

unread,
May 20, 2014, 11:46:25 AM5/20/14
to mitappinv...@googlegroups.com
If you are expecting multiple words, separated by spaces,
run a counter  i from 2 to the length of the string, to locate each letter
for the segment block.'
Use a for loop for that.

Capitalize the letter at position if the letter at position i-1 is blank.
Also capitalize position1, the special case outside the loop.

Check your text block drawer for upshift or capitalization blocks,
and for the block that lets you replace text in a string.

ABG



dank...@gmail.com

unread,
May 20, 2014, 7:52:12 PM5/20/14
to mitappinv...@googlegroups.com

Sorry, guys.

 

I’m new to all this, and I barely know how to use the blocks that the App Inventor site provides us. Will you be able to explain in simpler terms? Or perhaps which blocks I should use?

 

I greatly appreciate it again.

 

Thank you.

M. Hossein Amerkashi

unread,
May 20, 2014, 9:08:51 PM5/20/14
to
I just added a post  HERE that shows blocks for accomplishing this.

-Hossein.

Taifun

unread,
May 20, 2014, 9:25:36 PM5/20/14
to mitappinv...@googlegroups.com
nice example...
but if your purpose was to keep the blocks simpler, you should have chosen a local variable instead...
Taifun

dank...@gmail.com

unread,
May 21, 2014, 7:15:12 PM5/21/14
to mitappinv...@googlegroups.com

How do I create the purple command box (“call capitalize text”) that you laid out on your site? I can’t find it on AI.

M. Hossein Amerkashi

unread,
May 21, 2014, 7:36:28 PM5/21/14
to mitappinv...@googlegroups.com
That is a procedure
You may want to go through some of the tutorials HERE

-Hossein.

SteveJG

unread,
May 21, 2014, 8:26:13 PM5/21/14
to mitappinv...@googlegroups.com
Read this:  http://appinventor.mit.edu/explore/ai2/support/blocks/procedures.html

Try some of the blocks.  Clicking the blue icon with a right click exposes additional properties.    You name the procedure by typing over the words in the where it says procedure.    ..and yes, do some of the tutorials as suggested by Hossein; this method to create special blocks is explained in one of them.


Regards,
Steve

dank...@gmail.com

unread,
May 22, 2014, 8:51:47 PM5/22/14
to mitappinv...@googlegroups.com

Could you tell me what I'm doing wrong?


Taifun

unread,
May 22, 2014, 9:24:05 PM5/22/14
to mitappinv...@googlegroups.com
Your result is cap and not text
Taifun
Message has been deleted

SteveJG

unread,
May 22, 2014, 9:32:46 PM5/22/14
to mitappinv...@googlegroups.com


M. Hossein Amerkashi

unread,
May 22, 2014, 9:55:46 PM5/22/14
to mitappinv...@googlegroups.com

M. Hossein Amerkashi

unread,
May 23, 2014, 7:55:08 AM5/23/14
to mitappinv...@googlegroups.com
See the updated post that now includes explanation of blocks: http://amerkashi.wordpress.com/2014/05/20/1stlettercapitalization/


-Hossein.

dank...@gmail.com

unread,
May 23, 2014, 8:41:58 PM5/23/14
to mitappinv...@googlegroups.com
Steve,
Will you please explain the arrow you drew?

SteveJG

unread,
May 23, 2014, 8:51:50 PM5/23/14
to mitappinv...@googlegroups.com
If you are trying to duplicate Hossein's code exactly ... the arrow shows where your code is different from Hossein's blocks.

The block above split at spaces is initialize local cap to   in one instance and  set global varTemp to in the other instance (your code) ..  this is where possibly you too should have the s initialize local cap to block.

Is this your mistake, or do you want to do what you did.    I do not know, just wanted to point out the difference between the code blocks in the example and your code  (ignoring the variable names you introduce.  


Did that help?

Steve

Taifun

unread,
May 23, 2014, 10:03:04 PM5/23/14
to mitappinv...@googlegroups.com
as already said, use cap instead of text
Taifun


dank...@gmail.com

unread,
May 24, 2014, 7:08:46 AM5/24/14
to mitappinv...@googlegroups.com
Thanks, everyone. You helped me find what I was doing wrong, and I figured it out.
You all are the best.

dank...@gmail.com

unread,
May 26, 2014, 7:56:58 AM5/26/14
to mitappinv...@googlegroups.com
I read one of the items on the checklist to publish my app, and it was to have it tested out before it goes up on Google Play. Since all you gentlemen were patient and kind enough to help me build my very first app, I was wondering if you all would like to test it and to provide feedback.

Reply all
Reply to author
Forward
0 new messages