PAS2JS: VAL() - Incompatible type for arg no. 2: Got "Longint", expected "Boolea lazarus / 76-Pas2JS ---------------------------------------------------------------------- peter.dell · 2025-02-18 21:35 The following program compiles with with FPC, but results in 'Incompatible type for arg no. 2: Got "Longint", expected "Boolean' for the val in PAS2JS: I don't see were Booleans would come into play here. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program test; var     n: string;     v: integer;          p: word; begin   n:='$123';  val(n,v,p);end. ---------------------------------------------------------------------- rca · 2025-02-18 22:40 pas2js has its own system.pas and is a little different from fpc. Reviewing, pas2js has the following options for val: (system.pas) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure val(const S: String; out NI : NativeInt; out Code: Integer); overload;procedure val(const S: String; out NI : NativeUInt; out Code: Integer); overload;procedure val(const S: String; out SI : ShortInt; out Code: Integer); overload;procedure val(const S: String; out B : Byte; out Code: Integer); overload;procedure val(const S: String; out SI : smallint; out Code: Integer); overload;procedure val(const S: String; out W : word; out Code : Integer); overload;procedure val(const S: String; out I : integer; out Code : Integer); overload;procedure val(const S: String; out C : Cardinal; out Code: Integer); overload;procedure val(const S: String; out d : double; out Code : Integer); overload;procedure val(const S: String; out b : boolean; out Code: Integer); overload;  In all options, "out Code" is of type integer. So your code would work if you change the type of variable from word to integer: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  n: string;  v, p: integer; ---------------------------------------------------------------------- peter.dell · 2025-02-22 13:18 Thanks for the swift and precise reply. Val() issues are solved now. On to the next problem :-)