1) Word is 16-bit unsigned, 0..65535, you cannot assign 123456789 to it
2) there are function IntToStr(); an StrToInt();
3) WriteLn(); is part of compiler magic, you don't have to convert it to string
You can do both
writeln(myvar);
writeln(inttostr(myvar));