Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> error 44 type mismatch pp 322</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Error 44                       Type Mismatch                         pp 322

 Source:  Compiler

 Cause:   1)  Incompatible types of the variable and the expression in
          an assignment statement.

          2)  Incompatible types of the actual and formal paramters in
          a procedure or function call.

          3)  Expression type incompatible with index type in an
          array assignment.

          4)  Incompatible assignment between file types.

          5)  Incompatible types of operand expressions.


 Remedy:  Examine the statement ahead of the error cursor for the above
          conditions.
 Example (1):

       VAR
          IntVar  :  Integer                ; { Declare type Integer        }
          RealVar :  Real                   ; { Declare type Real           }

       BEGIN
          IntVar  := RealVar                ; { Illegal assignment          }
       END.











 Example (2):

       PROCEDURE One (A:Integer)            ; { Integer procedure paramter  }
          Begin
          End;

       BEGIN
          One (2.0)                         ; { Illegal paramter type       }
       END.











 Example (3):

       VAR
          ByteArray :  Array [0..9] of Byte ; { Array is type Byte        }
          RealVar   :  Real                 ; { Declare a type Real       }

       BEGIN
          RealVar   := 4                    ; { Assign integer value      }
          WriteLn (IntArray[RealVar])       ; { Invalid subscript type    }
       END.










 Example (4):

       TYPE
          FileType = Record
                     Name  : String [80]    ; { 80 byte type String         }
                     Age   : Byte           ; { Type Byte                   }
                     End                    ; { Of Record                   }
       VAR
          IntVar   : Integer                ; { IntVar is type Integer      }
          FileVar  : FileType               ; { File of FileType            }

       BEGIN
          Write (FileVar,IntVar)            ; { IntVar is not type FileType }
       END.






 Example (5):

       VAR
          RealVar   :  Real                 ; { Declare a type Real         }

       BEGIN
          RealVar   := 'Testing'            ; { Assign string value to Real }
       END.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson