xsharp.eu • error XS0019
Page 1 of 1

error XS0019

Posted: Tue Dec 02, 2025 9:23 pm
by vzeljko
I tried to prevent user to enter non-numeric characters in numeric textbox and put this code in TextBox_KeyPress method:

IF !Char.IsDigit(e.KeyChar) .AND. e.KeyChar != '.'
e.Handled := TRUE
ENDIF
IF e.KeyChar == ','
e.Handled := TRUE
ENDIF

and I got this error message:

error XS0019: Operator '!=' cannot be applied to operands of type 'char' and 'string'
error XS0019: Operator '==' cannot be applied to operands of type 'char' and 'string'

What is right operand?

Zeljko

Re: error XS0019

Posted: Tue Dec 02, 2025 9:32 pm
by FFF
Depends which Dialect you are using. If "VO", '.' is read as another syntax of "." - hence the error. IIRC, you could denote the type like c'.'

Re: error XS0019

Posted: Tue Dec 02, 2025 10:13 pm
by vzeljko
It works. Thank you Karl.

Zeljko