Problem with accents

Hi all,
I am developping a program to simulate a table tennis score including the position of players.
I have a problem when, in a spinner, I offer the possibility to choose the player that has to serve the ball. If I choose a player name without a spanish accent (for instance «Ramon») I can continue normally the program, but is the name include an accent (for instance «Ramón») when I try to get the selection I receive a message "List index smaller than 1. Select list item: Attempt to get item number 0, of the list....).
This only happens with names that include accents (which are necessary in spanish).
Any help ??

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thanks Anke, very kind as always.
I have found that the problem is not with the accent, but with a space that remains after the Name. As I normally use the same names they remain in my computer memory. When I begin to introduce the name, the computer offers the possibility to use a saved name; and this is the problem as the computer introduces the name but with a space at the end.
Probably Appinventor will consider this as a empty name or list.
Thanks in any case for your help.

to remove the trailing space, use a trim Block ahead of the Label or orange selection puzzle piece or whatever contains the name.

Does that work for you?

It seems interesting, but what will be the result in a name as «José Manuel», for instance ???

trim José Manuel_ (with a trailing space), should be José Manuel .

trim only removes the leading and trailing spaces, it does not remove ALL spaces.

Why not just try it? trim

Removes any spaces leading or trailing the input string and returns the result.

See the documentation trim

or all the documentation Text blocks

Thanks Steve !!
I have introduced this in my program to avoid more surprises !!!
It functions well !!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.