October 14th, 2004, 01:23 AM
ERROR:Operator not applicable to this operand type, help
hello, me agian Bubblez101
I got an error that i never seen before. knowing what it actually means would be a great help.
This is the error:
Operator not applicable to this operand type
here is the code that the error highlighted on:
if not ch := LetterList then
showmessage('You have used that letter already, choose another letter!');
LetterList.add := ch+LetterList;
I have declared this after implementation:
var Letter : array[1..26] of char;
LetterList = record
Letter : char;
Thanx in advance for any help. Agian.
October 14th, 2004, 08:24 AM
"ch := LetterList" is a statement. It has no return value, so no operators can be applied to it. You are trying to use "NOT". This looks like you have some C or Java background... Delphi / Pascal doesn't support the C-Way of assignments where you get the assigned value as return value.
ch := LetterList;
if NOT (ch<>0) err, nonsense: if ch=0 then...
(the NOT operator in Delphi can only be applied to boolean expressions)