The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.

Moderator: pjdixit

#72047 by Jsosnowski
Wed Aug 09, 2017 9:08 am
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?
#72048 by David A. Giesselman
Wed Aug 09, 2017 10:39 am
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

Who is online

Users browsing this forum: No registered users and 1 guest

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for AEC Professionals Since 1984