TYL PROGRAMMING LANGUAGE
▶ COMPARE CONDITION
Compare Condition
Compare condition statement is any statement that compares two scalar variables:
counter > 0
Compare options: Some condition signatures with compare conditions:
counter > 0 ?
quantity >= 0 ?
letter = 'A' ?
letter 'A' ?
The equality symbol '=' is not mandatory and can be omitted. conditions letter = 'A' and letter 'A' are the same, and check for equality between letter variable and string value 'A'.

Say we have a username string variable, and we want to check if username has at least 3 characters:
username 'tintin86'
usernamelen len username
usernamelen >= 3 ? print 'User name is valid'
User name is valid
Disable username with value 'aaa':
username 'aaa'
username 'aaa' ? print 'Invalid user name: `' + username + '`!' + newline + 'Please select another name.'
Invalid user name: 'aaa'!
Please select another name.
In line username 'aaa', username is compared to value 'aaa'. If it is equal to 'aaa', then the yes statement is executed, and the system prints the alert message.

It is posible to save the value 'aaa', in a variable, and to compare username to it:
username 'aaa'
invalidusername 'aaa'
username invalidusername ? print 'Invalid user name: `' + username + '`!' + newline + 'Please select another name.'
Invalid user name: 'aaa'!
Please select another name.
Here's Password Validator program:
errmsgs 'The password field is empty!' 'Password must be at least 8 characters!'
go:
password 'r9-Jo;3='
errmsgind validate password
errmsgind >= 0 ?
  print errmsgs errmsgind
  \
  print 'Password OK.' + newline + 'Continue with login...'
^
validate pwd:
pwdlen len pwd
pwdlen ?
  pwdlen < 8 ? 1 \ -1
  \
  0
^
Password OK.
Continue with login...
PART 3