For the sake of fun, I'd like to refresh my Pascal knowledge, so gotta review the basics again.
Let's see this Java code:
class ArrayTest {
public static void main(String args[]){
int[] numArray = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
}
}
Rewrite that into Pascal:
type
arrNum = array[1..10] of integer;
var
BBB: arrNum;
begin
BBB := [1,2,3,4,5,6,7,8,8,10];
end.
Compiling the code with FPC 3.2.2 on MacOS, the result is:
arrnum.pas(7,12) Error: Incompatible types: got "{Array Of Const/Constant Open} Array > of ShortInt" expected "arrNum"
arrnum.pas(10) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted Error: /usr/local/bin/ppcx64 returned an error exitcode
What's wrong here?
arrNumasTArray<Integer>instead.