Recent

Author Topic: Compiling fshComp error  (Read 3022 times)

eldonfsr

  • Full Member
  • ***
  • Posts: 208
Compiling fshComp error
« on: July 11, 2021, 01:43:31 am »
I tried to compile fshcomp but sent me this error

   sreditcur.pas(294,19) Error: Call by var for arg no. 1 has to match exactly: Got "TSrEditCur" expected "TCustomEdit"

some help great

thanks

dbannon

  • Hero Member
  • *****
  • Posts: 1600
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Compiling fshComp error
« Reply #1 on: July 11, 2021, 05:18:56 am »
Hmm, fshcomp appears to have been untouched for a very long time. 2009 ?

Its likely you will need to update something in it if it no one else has for twelve years.

So, look in sreditcur.pas, line 294, column 19, Lazarus will have highlighted that for you already. That line calls     RightLean(Self);, 'Self is, at this stage,  TSrEditCur but the declaration at line 41 expects a TCustomEdit -

Code: Pascal  [Select][+][-]
  1. procedure RightLean(var xe: TCustomEdit);

I have no idea whats going on here and it seems unlikely the original author is still active so it looks like you have a bit of debugging to do !  As a start, I cast 'Selt' to a TCustomEdit and it compiled. 

Code: Pascal  [Select][+][-]
  1.     RightLean(TCustomEdit(Self));

But as I am not going to add the unit to my install, I am creating the component "on the fly" and did not see any component popping up. Setting sensible positions and visibility did not help so, I am afraid, its up to you.  If you do get it going as expected, please remember to put a patch into Mantis so it gets fixed.   If you cannot make any progress, you could put just a bug report into Mantis ?

Good luck !
Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 1600
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Compiling fshComp error
« Reply #2 on: July 11, 2021, 05:38:54 am »
Sorry, I was being silly, yes, with that (possibly very wrong) fix, I was able to display the currency edit component on a form.  Up to you to test it I am afraid.
If you have not added that package to the ide, do something like -
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.       CEdit := TSrEditCur.create(Form1);
  4.       CEdit.Top := 10;
  5.       CEdit.Left := 10;
  6.       CEdit.Parent := self;
  7. end;  

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

eldonfsr

  • Full Member
  • ***
  • Posts: 208
Re: Compiling fshComp error
« Reply #3 on: July 12, 2021, 06:53:17 pm »
Ok Friend let me tried and get some experience with hat thanks....


 

TinyPortal © 2005-2018