12-11-2022, 03:29 PM
Adding the colon is the same as separating the silentInput$ statement from the PRINT statement. So why does it need to be separated? Well, it's because that semi-colon ";" after the PRINT statement is telling PRINT you want to include IF pInput$ = silentInput$ to it. Like Ra7eN figured out, that's a variable comparison expression when it is used that way.
PRINT a = b' That would be false, so it returns zero.
PRINT "Pete" = "Steve" ' That would be false, so it returns zero.
PRINT "Pete" > "Steve" ' Well, that's a story for another time!
So even though it still successfully calls the function, it isn't assigning the string variable pInput$ to the function return, it's comparing the null string pInput$ to the results of the the function. So it will always print "0" unless you just hit Enter without typing, which would return a -1, since a null string and an empty string are the same thing.
Pete
PRINT a = b' That would be false, so it returns zero.
PRINT "Pete" = "Steve" ' That would be false, so it returns zero.
PRINT "Pete" > "Steve" ' Well, that's a story for another time!
So even though it still successfully calls the function, it isn't assigning the string variable pInput$ to the function return, it's comparing the null string pInput$ to the results of the the function. So it will always print "0" unless you just hit Enter without typing, which would return a -1, since a null string and an empty string are the same thing.
Pete
If eggs are brain food, Biden takes his scrambled.