First, this is all being run on a Ryzen 7 laptop with 32G memory, 512g ssd and 1TB hd running KDE Neon Linux. I have Lazarus & FPC installed from .deb packages from here, and I have a separate laz/fpc install via fpcupdeluxe for cross compiling. both installs are isolated.
I hate to be a pain in the butt. I am working on the Ale editor that is part of the DT package from previous posts. So I am again working on a console application using Ncurses for cursor control and framed windows.
I want to use the newer nk keys for input (nkup, nkend, nkhome, etc) These are returned as integer values instead of characters for a more useful range. Using the edit function of the TnWindow object, I can't get the overlaid function that returns the last keystroke as an integer.
These are the overlaid functions of edit in the TnWindow object:
Function Edit(x,y,att,z,CursPos:Integer;es:String;Var ch : integer) : String;
Function Edit(x,y,att,z,CursPos:Integer;es:LongInt;Var ch : integer) : LongInt;
Function Edit(x,y,att,z,CursPos:Integer;es:Real;Var ch : integer) : Real;
Function Edit(x,y,att,z,CursPos:Integer;es:String;Var ch : Char) : String;
Function Edit(x,y,att,z,CursPos:Integer;es:LongInt;Var ch : Char) : LongInt;
Function Edit(x,y,att,z,CursPos:Integer;es:Real;Var ch : Char) : Real;
The parser is complaining about expecting a char instead of an integer. So, the parser is not seeing the instance that uses an integer instead of a char.... but it is seeing all of them as seen in the attached screenshot of the messages window.
I have solved this for the present time by making my own version of the Ocrt unit including Ncrt.inc file. I have renamed each instance and corrected the code to match.
Function EditSi(x,y,att,z,CursPos:Integer;es:String;Var ch : integer) : String;
Function EditLi(x,y,att,z,CursPos:Integer;es:LongInt;Var ch : integer) : LongInt;
Function EditRi(x,y,att,z,CursPos:Integer;es:Real;Var ch : integer) : Real;
Function EditSch(x,y,att,z,CursPos:Integer;es:String;Var ch : Char) : String;
Function EditLch(x,y,att,z,CursPos:Integer;es:LongInt;Var ch : Char) : LongInt;
Function EditRch(x,y,att,z,CursPos:Integer;es:Real;Var ch : Char) : Real;
These in turn call the variants in ncrt.inc. Is there a way to force a variant to be used? In the past overloaded variants just worked without any intervention. I understand that the old console stuff is not used nearly as often as Lazarus and the LCL stuff.
I am only reporting this here in the hope that it may help others in the future. I know laz is the present and future and I would not be finding these little things if I hadn't decided to revisit an old project that I may be the only one that ever uses. I have attached a test project to demonstrate the problem.
Thanks,
--- Jem