#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    5
    Rep Power
    0

    Question 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;
    type
    LetterList = record
    Letter : char;

    Thanx in advance for any help. Agian.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    "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)

    hth,
    M.

IMN logo majestic logo threadwatch logo seochat tools logo