Page 1 of 1

Missing DCAL for Delphi Constants?

PostPosted: Wed Aug 09, 2017 9:08 am
by Jsosnowski
I am attempting to use the f_open function in a D4D macro

Code: Select allFUNCTION f_open(VAR fl: fileType; Name: ShortString; Text: boolean;
   mode: aSInt): aSInt; stdcall; external AppName;

and am getting a compiler error that the mode value fmode_open, used in DCAL macros is not a declared constant. My macro 'uses' the uconstants.pas file, but it does not include a declaration of the fmode values. Referring back to the DCAL manual there should be three constant values: fmode_read, fmode_read_write, & fmode_write. Does anyone know where they are declared or what the 'asint' values assigned to each are?

Re: Missing DCAL for Delphi Constants?

PostPosted: Wed Aug 09, 2017 10:39 am
by David A. Giesselman
Hi Joe,

Not sure why they are not in uConstants.

const
mode_rd = 0; { open for reading }
mode_wr = 1; { open for writing }
mode_rdwr = 2; { open for reading and writing }

You may also use the Delphi constants as defined in SysUtils:

fmOpenRead = $0000;
fmOpenWrite = $0001;
fmOpenReadWrite = $0002;

Dave