How do i select a specific letter or number inside of a variable without knowing what the variable is

I recently have had the idea to make a game that allows the player to save the game via a save code, and hit a roadblock in the development of it when it came to the reading of the codes. before learning about MIT app inventor, I primarily used scratch to code. in scratch, there was a block that allowed the user to select a specific letter in a variable by using a number. for example, you could code it to use the logic of [if <letter (7) of (variable)> = A then:

you might want to use the segment block
http://ai2.appinventor.mit.edu/reference/blocks/text.html#segment
start in your case is 7
length in your case is 1

Taifun


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

You can also have look at following string functions..

the global variable is not necessary. the textbox.text can be used as global variable.

1 Like

Did Scratch have lists? Those are more powerful.