[fpc-pascal]A questions about delphi and pascal

Ramom Flores d'as Seixas fa2ramon at usc.es
Fri Apr 25 14:28:50 CEST 2003


   I would like to write mex[1] files in pascal, so I would like to adapt the 
DelphiMex[2] library from delphi to pascal. But I don't know Delphi, so I 
would thanks if somebody can help me. At this moment I have the following 
dude, in the cited library the autor wrote the following procedure:

692 procedure DelphiMexInitIO;
693   begin
694     with TTextRec(Output) do
695      begin
696        Mode := fmoutput;
.             BufSize   := sizeof(Buffer)-1;  { Leave a space to pad with #0 }
.             BufPtr    := @Buffer;
.            OpenFunc  := @MATLABOC;
             InOutFunc := @MATLABOUT;
             FlushFunc := @MATLABOUT;
             CloseFunc := @MATLABOC;
             Name[0]   := #0;

The variable "Output" has not been previously declared, so when I try to 
compile fpc outputs the following message

pascalmex.pas(694,12) Error: Illegal type conversion
pascalmex.pas(696,10) Error: Identifier not found MODE

I wonder if in delphi lines 692-694 equivalent to the following lines???:
692 procedure DelphiMexInitIO(Var Output:TTextRec);
693   begin
694     with Output do

Or perhaps in delphi Output is a wellknow variable?


[1] mex files are used in Matlab to implement external functions, using 
non-matlab languages as C or Fortran.

[2] DelphiMex is a Library that wrote Alexandre Kampouris in order to write 
mex files in delphi. (See http://radio-bip.qc.ca/DelphiMEX/DelphiMEX.html )

More information about the fpc-pascal mailing list