Forum > General

Got "TRawbyteSearchRec" expected "Searchrec"

(1/1)

lazer:
Hi,

I'm porting some old TPW code to FPC.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function direxpand(dir:varstring):varstring;begin  direxpand:=strpas(fileexpand(strbuf,strpcopy(strbuf,dir)));end; 

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

Is there no equivalent in fpc ?

Thanks,

Bart:
What does this have to do with topic title (Got "TRawbyteSearchRec" expected "Searchrec")?

Bart

marcov:
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:
Furthermore that code is considered unsafe, no length checks so prone to buffer overflow.
Use proper Pascal code.

Navigation

[0] Message Index

Go to full version