Expression of Integer Type is Expected

Description

Specification of the Fore language provides for using integer expressions for the statement, but the specified expression cannot be implicitly cast to the integer type.

Troubleshooting Tips

Check the type returned by the expression used in the statement. Use explicit transformation (the As operator), or special methods returning integer values.

Example

Sub UserProc;
Var
    i: Integer;
    j: Double;
Begin
    For i := 0 To j Do
        
    End For;
End Sub UserProc;

When the specified code is compiled, the following error is displayed: expression of integer type is expected. The error occurs because the "j" variable has the Double type and cannot be implicitly cast to the Integer type. To resolve the error, change the type of the "j" variable or use explicit transformation.

See also:

Compiler Messages