error XS0019

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
vzeljko
Posts: 37
Joined: Wed Sep 28, 2016 8:02 pm

error XS0019

Post 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
FFF
Posts: 1736
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Re: error XS0019

Post 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'.'
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
vzeljko
Posts: 37
Joined: Wed Sep 28, 2016 8:02 pm

Re: error XS0019

Post by vzeljko »

It works. Thank you Karl.

Zeljko
Post Reply