Recent

Author Topic: Got "TRawbyteSearchRec" expected "Searchrec"  (Read 317 times)

lazer

  • Full Member
  • ***
  • Posts: 215
Got "TRawbyteSearchRec" expected "Searchrec"
« on: October 16, 2022, 01:19:52 pm »
Hi,

I'm porting some old TPW code to FPC.
Code: Pascal  [Select][+][-]
  1. function direxpand(dir:varstring):varstring;
  2. begin
  3.   direxpand:=strpas(fileexpand(strbuf,strpcopy(strbuf,dir)));
  4. end;
  5.  

Quote
(661,21) Error: Identifier not found "fileexpand"

Is there no equivalent in fpc ?

Thanks,

Bart

  • Hero Member
  • *****
  • Posts: 4938
    • Bart en Mariska's Webstek
Re: Got "TRawbyteSearchRec" expected "Searchrec"
« Reply #1 on: October 16, 2022, 03:40:08 pm »
What does this have to do with topic title (Got "TRawbyteSearchRec" expected "Searchrec")?

Bart

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10584
  • FPC developer.
Re: Got "TRawbyteSearchRec" expected "Searchrec"
« Reply #2 on: October 16, 2022, 03:51:35 pm »
There is "fexpand" in unit dos (which is more TP like with 255 char limits ) and

the more modern delphi like expandfilename() in sysutils.

There is not much TPW support (like units windos and the like), and even what there is is limited to windows 3.x ports, not the general subset.

Best to use the sysutils variant.

Thaddy

  • Hero Member
  • *****
  • Posts: 12934
Re: Got "TRawbyteSearchRec" expected "Searchrec"
« Reply #3 on: October 16, 2022, 03:55:19 pm »
Furthermore that code is considered unsafe, no length checks so prone to buffer overflow.
Use proper Pascal code.
In memory of Gordon Moore  (January 3, 1929 – March 24, 2023) Just double the heaven every two years from now.

 

TinyPortal © 2005-2018