When i ran the code in post #20 it didnt run properly
Sorry, you'll have to explain. I don't know what "didn't run properly" means.
meant to mean: if the variable name (which equaled "Sammy") was entered,
Where is the data that was entered saved?
There was code in post #20 that saved the user's input.
A variable gets a value in an assignment statement:
x = 23; // give the value 23 to the variable x
The variable name gets a value here:
It will have that value until it is assigned a new value. It can not have two values at the same time.
I'm lost understanding what you think this statement does:
That code compares the contents of the name variable against the contents of the name variable.
When would that ever be not the same?