Why are you calling the procedure HideWord when the guessButton is pressed? Shouldn't be the evaluateLetter procedure called instead?
Also, you are calling the evaluateLetter procedure from inside the HideWord procedure, which I don't think makes a lot of sense. We don't need to mix the procedures.
You should have one procedure to create the masked word, and a different one to evaluate the letter typed and replace that _ for that letter in case it matches.
To populate the global Word, use the WHEN OTHER SCREEN CLOSED and use "result" as the word.
In the other screen, use this block to pass the word to Screen1:
In the evaluateLetter procedure you should have a FOR EACH like you do, and go from 1 to the length of the word to guess. You call that "position". That's good.
If you have spaces between the "_", you need to remove those before. Use the REPLACE ALL block for that and replace " " for "".
Then you have to compare with an IF the letter in the "position" being evaluated is = to the letter guessed.
If it is, you have to replace ONLY that _ with the letter. What you are doing is using a REPLACE ALL block which does with says: Replaces ALL occurrences of "_", not just one.
To do that, you need to do a little trick:
Split the masked word in two parts with the SEGMENT block and put them in two different variables:
First part is from
START 1
LENGTH current position - (minus) 1
Second part is from
START current position + 1
LENGTH (length of the masked word - (minus) length of the first part we separated before) - (minus) 1
That will leave the _ in the current position out. Which is the position of the letter guessed.
Next use the JOIN block to join the first part + the letter guessed + the second part.
That is the masked word now which will shows the letter guessed.
If you are using spaces between the _ then you need to create a procedure to add the spaces back before showing the masked word in your label.