Recognition of assume(s,DOM_STRING);
Publié : ven. sept. 07, 2018 10:34 pm
Hello, although there is the InputStr command to capture a string type data, for example with spaces, I think that the INPUT command could also act similarly if the variable is predefined as a string
EXAMPLE 1
If the user enters 1 2 3
print
1 2 3 // ok
EXAMPLE 2
If the user enters 1 2 3
syntax error // ok
EXAMPLE 3
should not return syntax error, because the expected type is a string
EXAMPLE 1
Code : Tout sélectionner
InputStr("Enter a string",s);
print("s="+s);
1 2 3 // ok
EXAMPLE 2
Code : Tout sélectionner
input("Enter a string",s);
print("s="+s);
syntax error // ok
EXAMPLE 3
Code : Tout sélectionner
assume(s,DOM_STRING);
input("Enter a string",s);
print("s="+s);